I have a problem where my application crashes what seems to be at random. It works for maybe up to 30 min, and then I just crashes, if I debug I get an error at the row mySocket.SendAsync(completeArgs)
It's a stackoverflow error... I do the following lines of code everytime I want to send something, and that is quite alot, maybe something every 0.5 second. I have tryed to set mySocket.NoDelay = true;
but that did not solve the problem. This is the client side of the applications.
SocketAsyncEventArgs completeArgs = new SocketAsyncEventArgs();
completeArgs.SetBuffer(MsgBuffert, 0, MsgBuffert.Length);
completeArgs.UserToken = this.mySocket;
completeArgs.RemoteEndPoint = this.hostEndPoint;
completeArgs.Completed += new EventHandler<SocketAsyncEventArgs>(OnSend);
mySocket.SendAsync(completeArgs);