netty/netty — Issue #190: WebSockets does not release ports at once
Author: boldt
Created: 2012-02-15 14:09:32+00:00
State: open

I am using the given `WebSocketServer` which runs on *Port 9090* instead of 8080.

I wrote a simple WebSocket application, which opens a WebSocket every 100 milliseconds:

* http://html5.dennis-boldt.de/netty/

Like this I simulate the opening and closing of approx. 10 WebSocket connections per second. I started the application 6-7 times in different tabs to simulate 60-70 connection per second. After the applications are running for some time, they aren't able to connect anymore (due to `ulimit`?). Thus, I observed the connections to port *9090* in `netstat`:

`while true; do sudo netstat -tupla | grep 9090 | wc -l; sleep 1; done;
`
I realized, that a closed WebSocket connection does not release the opened port at once:

* http://paste.dennis-boldt.de/2012/github.com/netty_netstat

Quite fast I got more than 1600 opened ports. Even after I close the whole browser (Line 150), it still takes 40 seconds until all opened port are released.

Dennis