Re: [xSocket-develop] a bunch of TIME_WAIT sockets sitting around
Status: Inactive
Brought to you by:
grro
|
From: Gregor R. <gre...@gm...> - 2010-03-12 05:01:31
|
Hello Matt, this is a behaviour of the underlying operation system. TCP defines that closed sockets are transit to TIME WAIT to make sure, that all data was written/received. The duration can be configured on os level. For instance http://publib.boulder.ibm.com/wasce/V1.0.1/en/Tasks/Tuning/Windows.html describes how to do this for windows. You will also find tutorials how to do this for Unix. Gregor ----- Original Message ----- From: Matt Rodatus Sent: 03/11/10 09:06 PM To: xso...@li... Subject: [xSocket-develop] a bunch of TIME_WAIT sockets sitting around Hello, I've begun using xSocket, and I'm thankful for the library -- it is very useful for what we want to accomplish. Our application sends length prefixed strings over sockets. For each connection, the server receives one string and sends one string in response. Then the server closes the connection. I'm using transactional reads on the server, and it's working well -- better than anything else I've tried. However, even though the server does close the connection, a lot of sockets with TIME_WAIT are showing up in netstat -a | grep SERVERPORT after the fact. They disappear after a minute or two, but I'm wondering if there's any way I can get rid of them right away. For example, should I do a blocking closing operation from within the onData method, when I'm done with the connection and want to close it? Obviously, the connection passed to onData is an INonBlockingConnection, so the close operation would also (presumedly) be non-blocking, which I'm guessing may be why the sockets stick around as TIME_WAIT for a bit. Am I anywhere near home base in my diagnosis and proposed solution? If not, what would you suggest? Thanks, Matt ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ xSocket-develop mailing list xSo...@li... https://lists.sourceforge.net/lists/listinfo/xsocket-develop |