tcp connection does not close when Arduino resets

The Java program should have a timeout on the tcp connection like a browser does. If the connection breaks, there is nothing sent, so the connection will stay open. I use 10 seconds on my ethernet shield timeout.