Howto reset and reuse a socket (not having a 7.80 sec delay)
From: Troels Smit (troels_smit_at_hotmail.com)
Date: 06/08/05
- Next message: Zeljko Vrba: "Re: Shared Libraries : library paths ??"
- Previous message: Peter T. Breuer: "Re: Shared Libraries : library paths ??"
- Next in thread: David Schwartz: "Re: Howto reset and reuse a socket (not having a 7.80 sec delay)"
- Reply: David Schwartz: "Re: Howto reset and reuse a socket (not having a 7.80 sec delay)"
- Reply: Andrei Voropaev: "Re: Howto reset and reuse a socket (not having a 7.80 sec delay)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 8 Jun 2005 04:47:37 -0700
Hi,
Im writing a client/server application using c++ socket on linux.
The clients must be able to reconnect to the server in an efficient
manner.
The server is receiving data from the client.
The client is transmitting about 50% of the time in 200ms intervals.
My problem occur when I reset the client.
If the client is not transmitting when I reset it, the server will not
do anything until the client re-connects. When the client re-connects
the new connection is accepted and the old connection closed. This is
fine and progresses very fast.
Now, if the client IS transmitting when I reset it, the server will
receive a "Connection reset by peer" and close the connection. When
the client then re-connects exactly 7.80 seconds!! will pass before
data starts to flow. The connections is accepted (so the new
connection is immidiately seen by the server) but the second packet
will not be received at the server, before 7.80 seconds has passed,
then everything again runs in a smooth manner.
I have set the socket options "REUSE" and "LINGER". Where Linger is
set in aboard mode so the old tcp-connection should be immidiately
terminated.
Any ideas ?
Thank you very much in advance :-)
/TS
- Next message: Zeljko Vrba: "Re: Shared Libraries : library paths ??"
- Previous message: Peter T. Breuer: "Re: Shared Libraries : library paths ??"
- Next in thread: David Schwartz: "Re: Howto reset and reuse a socket (not having a 7.80 sec delay)"
- Reply: David Schwartz: "Re: Howto reset and reuse a socket (not having a 7.80 sec delay)"
- Reply: Andrei Voropaev: "Re: Howto reset and reuse a socket (not having a 7.80 sec delay)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|