Re: Detecting clsoed socket on OutputStream.Write
- From: Knute Johnson <nospam@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 30 Jun 2006 08:45:07 -0700
EJP wrote:
Knute Johnson wrote:
That's why the read throws an exception immediately then, the outgoing data is locally buffered? How long will the local data be buffered? Does not the flush() cause it to go now?
All that flush() does is is get it out of the JVM into the socket send buffer. The data can only go from there onto the wire if there is room in the receiver's receive buffer, and if the receiver is slower than the sender eventually the room will run out. Also, data is only deleted from the sender's send buffer once it has bene acknowledged by the receiver. So if the receiver completely disappears eventually your send buffer will fill up and eventually your TCP will time out the write attemps and reset the connection. Your *next* read or write will then discover this and get a SocketException.
I guess I was under a misconception then, I thought if you closed a socket that the other end was notified of the close not that your buffer filled up. Is that not correct?
--
Knute Johnson
email s/nospam/knute/
.
- References:
- Detecting clsoed socket on OutputStream.Write
- From: david . topham
- Re: Detecting clsoed socket on OutputStream.Write
- From: Knute Johnson
- Re: Detecting clsoed socket on OutputStream.Write
- From: EJP
- Re: Detecting clsoed socket on OutputStream.Write
- From: Knute Johnson
- Re: Detecting clsoed socket on OutputStream.Write
- From: EJP
- Detecting clsoed socket on OutputStream.Write
- Prev by Date: Re: Simple(?) synchronized() block question
- Next by Date: sms with at commands
- Previous by thread: Re: Detecting clsoed socket on OutputStream.Write
- Next by thread: List all WAR classes
- Index(es):
Relevant Pages
|
|