when client was closed, how let server know that?

i have a question:i have a server with ServerSocket, and client with Socket, everything are done.when client program was closed, how server know client closed?
[180 byte] By [NhTina] at [2007-11-26 17:06:27]
# 1
You should implement reading with timeout or keepalive functionality in your protocol.
Michael.Nazarov@sun.coma at 2007-7-8 23:34:12 > top of Java-index,Core,Core APIs...
# 2
and you should also recognize the end-of-stream condition when reading from the client in the server.
ejpa at 2007-7-8 23:34:12 > top of Java-index,Core,Core APIs...