Re: I want an event when program I'm connected with closes Socket
From: Esmond Pitt (esmond.pitt_at_not.bigpond.com)
Date: 01/13/05
- Next message: hilz: "Re: (cast) iteration not working???"
- Previous message: Dave Glasser: "Re: Problems uploading a file in UTF-8 using Tomcat / Struts"
- In reply to: opalpa_at_gmail.com: "I want an event when program I'm connected with closes Socket"
- Next in thread: opalpa_at_gmail.com: "Re: I want an event when program I'm connected with closes Socket"
- Reply: opalpa_at_gmail.com: "Re: I want an event when program I'm connected with closes Socket"
- Reply: opalpa_at_gmail.com: "Re: I want an event when program I'm connected with closes Socket"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 13 Jan 2005 00:44:59 GMT
opalpa@gmail.com wrote:
> I've written socket code previously and am confronted with a new
> situation: I have a server which manages multiple connections and each
> connections can be reused for multiple messages. The client does not
> say anything before closing, it just closes. What is the correct way
> to determine that client closed socket?
>
> I've looked at java.net.socket 1.5 documentation and it is much too
> imprecise for my understanding. Like does isClosed() mean that close()
> was called on instance? Does it mean that specific symbols were
> received by instance from client?
isClosed tells you whether *you* have closed *your end*.
If the other end closes, a read will return -1 or an EOFException.
- Next message: hilz: "Re: (cast) iteration not working???"
- Previous message: Dave Glasser: "Re: Problems uploading a file in UTF-8 using Tomcat / Struts"
- In reply to: opalpa_at_gmail.com: "I want an event when program I'm connected with closes Socket"
- Next in thread: opalpa_at_gmail.com: "Re: I want an event when program I'm connected with closes Socket"
- Reply: opalpa_at_gmail.com: "Re: I want an event when program I'm connected with closes Socket"
- Reply: opalpa_at_gmail.com: "Re: I want an event when program I'm connected with closes Socket"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|