Fundamentals question, is this how it works?
- From: "Daniel" <DanielV@xxxxxxxxxxxxxxxx>
- Date: Thu, 20 Jul 2006 19:41:13 +0100
Hey
With a tcp stream socket what happens when it is reading say 4000bytes and
495 bytes come in?
I am finding when i add a delay in my reading i always read my data
correctly. If i let it run at full speed it gets stuck. I am using
asynchornous sockets.
On my understanding is this right, say i have a receive buffer of 1024 bytes
and i send 2048 bytes, then straight after i send 400 bytes:
1) Client receives 1024 bytes of data from original 2048 sent, and processes
it
2)After client reads all the data it receives the next 1024 bytes, and
processes it
3) then it reads the first 400 bytes and processes it.
Am i right in that it queues up that way? And why if i slow down the reading
does it become reliable but if i let it read at full speed it gets stuck.
When i say stuck i mean it ignores new data coming in. So it does this, but
this is accurate to my real situation
1) Reads 425 bytes
2) now no longer reads any new data
Is it possible it is trying to read too quick? since it is in a loop anyway
surely it has to finish reading the first before it can continue anyhow?
.
- Follow-Ups:
- Re: Fundamentals question, is this how it works?
- From: Michael K. O'Neill
- Re: Fundamentals question, is this how it works?
- Prev by Date: Getting a list of files in a directory on FTP server
- Next by Date: Re: Fundamentals question, is this how it works?
- Previous by thread: Getting a list of files in a directory on FTP server
- Next by thread: Re: Fundamentals question, is this how it works?
- Index(es):
Relevant Pages
|