mysterious stuck connections

From: Dan Kegel (dank@alumni.caltech.edu)
Date: Thu May 18 2000 - 16:20:30 EST


On a vanilla Redhat 6.2 system, I'm having a problem
frequently where data appears to get stuck on its way
from the client to the server. Both client and server
are applications I wrote using poll().
I know it's probably my own fault, but I'm having trouble
tracking it down.
If both client and server are running on the same machine,
and I do a run with 100 connections, sometimes
about a quarter of them get stuck, usually before the first
byte has been received by the server.
Here's the output of netstat -a on the two kinds of stuck
connections I see:

[dank@krunch dev]$ netstat -a | grep 4276
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 72 0 masqhost:5210 masqhost:4276 ESTABLISHED
tcp 0 0 masqhost:4276 masqhost:5210 ESTABLISHED

That means the kernel is waiting for the server process to read 72 bytes
(probably the first 72 bytes after the connection is established).
This looks like a bug on my part.

[dank@krunch dev]$ netstat -a | grep 4292
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 72 masqhost:4292 masqhost:5210 ESTABLISHED
tcp 0 0 masqhost:5210 masqhost:4292 SYN_RECV

That means the server (port 5210) is waiting for the client to send an ACK, I think.
I don't understand how this one could be my fault.

Can anyone explain what kind of programming error on my part might
cause the second kind of error?

Thanks,
Dan

-- 
Entia non sunt multiplicanda praeter necessitatem.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue May 23 2000 - 21:00:16 EST