[xSocket-develop] a bunch of TIME_WAIT sockets sitting around
Status: Inactive
Brought to you by:
grro
|
From: Matt R. <ma...@ro...> - 2010-03-11 20:06:36
|
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 |