Re: Asynchronous sockets and buffer size
- From: "Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Sun, 27 May 2007 10:42:53 -0700
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
.
- Follow-Ups:
- Re: Asynchronous sockets and buffer size
- From: Matthew Geyer
- Re: Asynchronous sockets and buffer size
- References:
- Asynchronous sockets and buffer size
- From: Matthew Geyer
- Re: Asynchronous sockets and buffer size
- From: Michael Rubinstein
- Re: Asynchronous sockets and buffer size
- From: Matthew Geyer
- Re: Asynchronous sockets and buffer size
- From: Peter Duniho
- Re: Asynchronous sockets and buffer size
- From: Matthew Geyer
- Asynchronous sockets and buffer size
- Prev by Date: Re: Asynchronous sockets and buffer size
- Next by Date: Re: Asynchronous sockets and buffer size
- Previous by thread: Re: Asynchronous sockets and buffer size
- Next by thread: Re: Asynchronous sockets and buffer size
- Index(es):
Relevant Pages
|