Re: Sockets, writing data and shutdownOutput
- From: "HK" <pifpafpuf@xxxxxx>
- Date: 2 Aug 2005 11:27:51 -0700
jan V wrote:
> > > close() on the stream???? The server is only going to see EOF if you
> close()
> > > the OutputStream in the client....
> >
> > Not true. shutdownOutput() on the client side signals
> > EOF to the server. However, a close() on the
> > OutputStream shuts down the whole socket,
>
> Well, maybe you're using a different version of Java than the version (1.3)
> I used to build a system which totally relied on closing output streams to
> send EOFs to the recipient. Under 1.3 this worked 100% of the time... what
> version are you using?
I am using 1.4, and 1.5 has the same bug, see
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4717638
Direct from the sources of SocketOutputStream.close():
if (socket != null) {
if (!socket.isClosed())
socket.close();
This does not look like merely closing the output
side of things.
The bug mentioned above, luckily, is still open
despite the unfavorable comment from SUN.
According to the comment, this was always a
problem, which somehow contradicts your statement.
Maybe you did not expect outstanding response data
after closing the output side of the socket in
the client.
Harald.
.
- Follow-Ups:
- Re: Sockets, writing data and shutdownOutput
- From: jan V
- Re: Sockets, writing data and shutdownOutput
- References:
- Sockets, writing data and shutdownOutput
- From: HK
- Re: Sockets, writing data and shutdownOutput
- From: jan V
- Re: Sockets, writing data and shutdownOutput
- From: HK
- Re: Sockets, writing data and shutdownOutput
- From: jan V
- Re: Sockets, writing data and shutdownOutput
- From: HK
- Re: Sockets, writing data and shutdownOutput
- From: HK
- Re: Sockets, writing data and shutdownOutput
- From: jan V
- Sockets, writing data and shutdownOutput
- Prev by Date: Clone java collection & static variable??
- Next by Date: Re: Thread.sleep(10000)
- Previous by thread: Re: Sockets, writing data and shutdownOutput
- Next by thread: Re: Sockets, writing data and shutdownOutput
- Index(es):
Relevant Pages
|