Java Apache Mina generating lots of connections to localhost
===

For a server stress test I am making a program that opens lots of TCP connections to this server (as many as possible).

However, when I'm at about 2200 connections the buffer space runs out. I have already set the Windows settings to allow up to 65534 connections. When I look at netstat I see the program opens about 60000 unused and unwanted connections to localhost. All of these connections open from computername:x and go to localhost:x+1.

The code opening these connections is as follows (in a loop of 5000 times):

    NioSocketConnector connector = new NioSocketConnector();
    connector.setHandler(new ConnectionHandler());
    connector.connect(new InetSocketAddress(HOSTNAME, PORT));

The `ConnectionHandler` class is pretty much empty and implements `IoHandler`.

Does anyone know what is causing the 60000 unused connections to Localhost?