Thanks Lukas, I'd closed the server but I didn't observe that the address was changed to TIME_WAIT and I can't restart the server until this state is change.
Can I reduce the time of TIME_WAIT? And I've another doubt: How can I disconnect an especific client? Is this possible? Regards, Fabrício Lukas Gebauer escreveu: >> When I finish the server with a client connected in it and try to >> start the server again I receive the error message "Address already in >> use". But if I check with netstat -an I haven't this address in use. >> Do you know why this occour? > > Are you sure if your previous server instance is really closed before > you are starting server again? It may need some time until all > threads are terminated and until all clsoed sockets are available for > reuse. (see TCP socket state diagram) > > >> What's the correct form to disconect a server when there are clients >> connected in it: > > Just close all sockets. Is good idea to set 'linger' option for > listening socket on the server. (all accepted sockets derive this > option setting from listening socket, or you can set it for all > client sockets manually for safety. > > I suggest to use sock.SetLinger(true, 10); > > > > > ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ synalist-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/synalist-public
