hoh...@gmail.com
unread,Jul 3, 2013, 8:28:22 PM7/3/13You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi,
I have this issue where I'm trying to restart a network connection on a particular or on a second process running on the same machine. If I terminate connections just before launching the process the other process is able to connect properly. If I terminate the connection afterwards but before trying to connect on the other process it fails.
Works:
Process 1 : bind / listen / accept <- Ok we are connected
Client : Tries to connect <- Great connects
Process 1 : closesocket on server and client (Process 1 Keeps running)
Client : Tries to reconnect
Process 2 : Starts
Process 2 : Starts bind / listen / accept <- Ok we are connected
Does not work:
Process 1 : bind / listen / accept <- Ok we are connected
Client : Tries to connect <- Great connects
Process 2 : Starts
Process 1 : closesocket on server and client (Process 1 Keeps running or I kill it)
Process 2 : waits a little
Client : Tries to reconnect
Process 2 : Starts bind / listen / accept <- Not ok accept hangs
Client : Gets past connect and gets stuck later because of the hanging connect
I also use SO_REUSEADDR. Note using exclusive in the second case reports that the socket is already in use.
Has anyone seen this before. It appears to me that when the process starts up if sockets have already been established it assumes they are always established.
Thanks for any help in advance. This is driving me nuts :(