[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ProgSoc] Java Socket Question ..



This Question is for java guru's.

I have an applet that uses a standard socket (java.net.socket). that 
connects to a unix server.
I need to know how to determine when the server side hangs up. 

It is possible to determine if the socket has problems, by trying to 
read from the input stream, if a EOF is received then I assume the socket 
is closed.  However I dont want to periodically read from the input 
stream, just to check whether the socket is up.  If I try this using 
buffered data channel, I lose my position and everything that is waiting
for to be read, after the check.
 
Anyone have any ideas of how to determine whether a socket is closed.
 
phil.

--
Phil Shead                         phil@nospam.socs.uts.edu.au
                                   phil@nospam.ftoomsh.progsoc.uts.edu.au

--
You are subscribed to the progsoc mailing list. To unsubscribe, send a
message containing "unsubscribe" to progsoc-request@nospam.progsoc.uts.edu.au.
If you are having trouble, ask owner-progsoc@nospam.progsoc.uts.edu.au for help.

This list is archived at <http://www.progsoc.uts.edu.au/lists/progsoc/>