Re: Asynchronous sockets and buffer size

Tech-Archive recommends: Fix windows errors by optimizing your registry



Thanks for the tips. I wasn't encountering a problem with EndSend yet because I was lucky enough to be sending all the data each time. Now I check the byte count.

I also added Socket.Shutdown(SocketShutdown.Both) before I close the socket. Still having the same problem.

That's pretty much all of my network code except for the try catch blocks where i catch SocketExceptions, the part where i create the socket, and the part where it begins with Socket.BeginConnect. (Though the BeginConnect is called by a BackgroundWorker)

The buffer only fills up once, after which Socket.EndReceive returns 0.

If I ignore the 0 that EndReceive returns and try another BeginReceive for the hell of it nothing happens.
.



Relevant Pages