Re: How can I prevent TCP/IP from grouping together multiple SendText requests into one packet?
- From: David Zimmerman <dzimm@xxxxxxx>
- Date: Tue, 25 Oct 2005 21:08:38 GMT
jklimek@xxxxxxxxx wrote:
Right now my client sends the word "UPDATE" to my server and the server then sends a bunch of packets (tstringlist) that contain artist name, track name, etc.
The problem is that I'm using Socket.SendText() so fast that TCP/IP is grouping lots of SendText requests into one TCP/IP packet and then it gets very hard to parse them on the client...
TCP is a stream, you have no control over how it arranges the bytes in the stream. You will find that the bytes get 'packetized' in lots of strange and interesting ways depending on the situation of the moment. You will have to put things into the stream that allows the client to pars ethe answer (EG a length before each answer). You will also ahev to teach the client to read bytes until it gets what it needs regardless of how the stream got "packetized".
.
- References:
- Prev by Date: Password Generator
- Next by Date: Re: How can I prevent TCP/IP from grouping together multiple SendText requests into one packet?
- Previous by thread: How can I prevent TCP/IP from grouping together multiple SendText requests into one packet?
- Next by thread: Re: How can I prevent TCP/IP from grouping together multiple SendText requests into one packet?
- Index(es):
Relevant Pages
|