Re: How can I prevent TCP/IP from grouping together multiple SendText requests into one packet?
- From: "Maarten Wiltink" <maarten@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 25 Oct 2005 23:28:38 +0200
<jklimek@xxxxxxxxx> wrote in message
news:1130271306.996963.41680@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[...]
> 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...
We told you this. There are no TCP packets, there is only a TCP stream.
If it's hard to parse, it's because you made it so. If you send
"name=value" pairs, each terminated by a CRLF, you can buffer the
stream as you receive it, checking each time you receive anything if
there is a CRLF in your buffer, and if there is you know you have a
complete name-value pair at the front of the buffer. Repeat until
bored.
How do you know the response for a single UPDATE command is finished?
Perhaps you need an empty line at the end.
Groetjes,
Maarten Wiltink
.
- References:
- Prev by Date: Re: How can I prevent TCP/IP from grouping together multiple SendText requests into one packet?
- Next by Date: Re: 3D graphics with Delphi
- Previous by thread: Re: How can I prevent TCP/IP from grouping together multiple SendText requests into one packet?
- Next by thread: Password Generator
- Index(es):
Relevant Pages
|