From: Phillip Susi
Ge van Geldorp wrote:
I've been wrong before, but that's my
interpretation of
what's happening. We've only sent one byte and are trying
to send another single byte.
Wait a second... why is it sending only one byte at a time?
The caller is only send()ing one byte at a time?
Yup.
The caller really should not be doing that.
Hmm, I just read a Larry Wall quote: "we're not terribly interested in
telling people what they can't do" :-)
You may be seeing the nagle
algorithm kicking in then, which specifically tries to wait
for an ack before sending more frames, _unless_ there is
enough queued data to send another complete frame.
This prevents tons of single byte frames from flooding the
network, instead coalescing them into larger frames.
I'm curious now about the application. Why is it sending one
byte at a time to itself via the loopback? That seems to be broken.
The application is the Mozilla ActiveX control. My guess (but I haven't
studied its source code to confirm this) is that it is doing this as a form
of inter-thread communication. It might be broken, but it works ok on
Windows, so we have to make it work also.
In my first post I've included a simple test app which demonstrates the
behaviour. I can send it again if you like.
GvG