I've written a fairly simple server app using the TWSocket component.

The app listens on port 80 for packets with a particular structure, and
sends a reply. I've tested it with up to 12 clients connected, all sending
requests as fast as possible, and all works well.

As soon as I connect a real client it works for a while then fails then
continues to work again.

Having done an Ethereal trace of the packets, when it goes wrong I get the
following type of situation (for a given client IP address)

Time Remote Port Local Port Flags Notes

--- 24997 -> 80 [SYN] Seq=0 Len=0 MSS=1460

0.0 24997 <- 80 [SYN ACK] Seq=0 Ack=1 Len=0 MSS=1460 Win=65535

0.2 24997 -> 80 [RST ACK] Seq=1 Ack=1 Win=0 Len=0

Here my application has seen a client connection and disconnection.

1.4 24998 -> 80 [SYN] Seq=0 Len=0 MSS=1460

1.0 24998 -> 80 [SYN] Seq=0 Len=0 MSS=1460

1.0 24998 -> 80 [SYN] Seq=0 Len=0 MSS=1460

1.0 24998 -> 80 [SYN] Seq=0 Len=0 MSS=1460

1.0 24998 -> 80 [SYN] Seq=0 Len=0 MSS=1460

Here my application has also seen a client connection and disconnection, but
the trace shows no connection was established.

2.2 25000 -> 80 [SYN] Seq=0 Len=0 MSS=1460

1.0 25000 -> 80 [SYN] Seq=0 Len=0 MSS=1460

1.0 25000 -> 80 [SYN] Seq=0 Len=0 MSS=1460

1.0 25000 -> 80 [SYN] Seq=0 Len=0 MSS=1460

1.0 25000 -> 80 [SYN] Seq=0 Len=0 MSS=1460

Here my application has also seen a client connection and disconnection, but
the trace shows no connection was established.

This pattern repeats 8 more times (port numbers 25001-25008) then I get

0.6 25009 -> 80 [SYN] Seq=0 Len=0 MSS=1460

1.0 25009 -> 80 [SYN] Seq=0 Len=0 MSS=1460

1.0 25009 -> 80 [SYN] Seq=0 Len=0 MSS=1460

1.0 25009 -> 80 [SYN] Seq=0 Len=0 MSS=1460

1.0 25009 -> 80 [SYN] Seq=0 Len=0 MSS=1460

My application does *not* see a connection for remote port 2509

10.3 25010 -> 80 [SYN] Seq=0 Len=0 MSS=1460

1.6 25011 -> 80 [SYN] Seq=0 Len=0 MSS=1460

1.0 25011 -> 80 [SYN] Seq=0 Len=0 MSS=1460

0.2 25010 <- 80 [SYN ACK] Seq=0 Ack=1 Len=0 MSS=1460 Win=65535

0.2 25010 -> 80 [RST ACK] Seq=1 Ack=1 Win=0 Len=0

0.2 25011 -> 80 [SYN] Seq=0 Len=0 MSS=1460

0.0 25011 <- 80 [ACK] Seq=0 Ack=1 Len=0 Win=65535

1.0 25011 <- 80 [SYN ACK] Seq=0 Ack=1 Len=0 MSS=1460 Win=65535

0.0 25011 -> 80 [ACK] Seq=0 Ack=1 Len=0 Win=4096 TCP ACKed Lost Segment

0.0 25011 <- 80 [ACK] Seq=0 Ack=1 Len=0 Win=65535

0.2 25011 -> 80 [ACK] Seq=1 Ack=1 Len=0 Win=4096 TCP ACKed Lost Segment

0.0 25011 -> 80 [ACK] Seq=1 Ack=1 Len=0 Win=4096 TCP Dupe ACK

0.0 25011 -> 80 [PSH ACK] Seq=1 Ack=1 Len=66 Win=4096

0.1 25011 <- 80 [PSH ACK] Seq=1 Ack=67 Len=8 Win=65469

0.2 25011 -> 80 [ACK] Seq=67 Ack=9 Len=0 Win=4088

0.0 25011 <- 80 [PSH ACK] Seq=9 Ack=67 Len=16 Win=65469

0.2 25011 -> 80 [ACK] Seq=67 Ack=25 Len=0 Win=4080

My app sees a connect and disconnect for remote port 25010 then a connect
from port 25011 which seems to be handled correctly.

It then works for a while until a similar pattern is repeated.

The times shown are seconds since the previous packet.

I'm really puzzled as to what could be going on here, and have no idea how
to begin to debug/fix it.

The Ethereal trace is from the machine running the app, so no packets could
have been lost between the PC upon which the app is running and the machine
logging the packets.

I really would appreciate any pointers you can give.
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to