If you plug out the ethernet cable, the tcp connection still thinks everything is fine, until you plug it back in and it notices that the tcp connection is closed.
Maybe there's an error handler for that, not sure, but regardless the ServerSocket should notice that it is no longer connected and it should close the connection (either from the keep alive or some other more direct mechanism).