Bug ID: JDK-4197666 Socket descriptors leak into processes spawned...
I have included simple Java programs that demonstrate this bug.You can use the sleep argument with TCPServer to get to hang around before exiting, this allows you to make sure TCPClient can connect succefully when TCPServer is still running. Sample code