Re: Asynchronous sockets and buffer size

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



On Sun, 27 May 2007 02:37:12 -0700, Matthew Geyer <nospam@xxxxxxxxxxxxxxxxxxxx> wrote:

[...]
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)

Well, it obviously is not all of the network code, since you didn't post anything at all from the server side.

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

EndReceive() isn't going to return 0 for the byte count unless the connection has been closed. After it returns 0, of course you will not have any more successful reads from the socket.

Either you have a bug in the receiving code, in which you actually receive more data than you have accounted for somehow, or you have a bug in the sending code, in which the connection is closed before the client has had a chance to receive all of the data. Without a complete-but-concise sample code that reliably reproduces the problem to look at, it would be impossible for anyone reading your posts to know what's actually happening. But it pretty much has to be one of those two things.

Pete
.



Relevant Pages

  • Re: FreeBSD 7 TCP syncache fix: request for testers
    ... My suspicion is that the "Segment failed SYNCOOKIE authentication" message is ... My theory is that the connection is silently dropped, ... maybe I have something that can be related to this bug. ... the connection and releases the socket while the ...
    (freebsd-net)
  • Re: FreeBSD 7 TCP syncache fix: request for testers
    ... My suspicion is that the "Segment failed SYNCOOKIE authentication" message is ... My theory is that the connection is silently dropped, ... maybe I have something that can be related to this bug. ... the connection and releases the socket while the ...
    (freebsd-current)
  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation [try #3]
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... kernel socket family. ... presentation side is left to the client. ... Each connection goes to a particular "service". ...
    (Linux-Kernel)
  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... Make it possible for the client socket to be used to go to more than one ... Each connection goes to a particular "service". ...
    (Linux-Kernel)
  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation [try #2]
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... Make it possible for the client socket to be used to go to more than one ... Each connection goes to a particular "service". ...
    (Linux-Kernel)