Re: Sockets, writing data and shutdownOutput
- From: "HK" <pifpafpuf@xxxxxx>
- Date: 2 Aug 2005 07:35:47 -0700
jan V wrote:
> > > Why don't you socket.shutdownOutput() in your main thread, after you;ve
> > > fully received the web server's response? Why do you have to call it so
> > > early, before having processed the reply?
> >
> > I want to make sure that even the last byte
> > of data gets through to the server and is
> > not lingering somewhere in an output
> > buffer of the client.
>
> That's the job of flush(), not shutdownOutput().
Ok, my explanation was slightly wrong. It is not
the data hanging in a buffer. It is the EOF.
Without shutdownOutput() the server never gets an
EOF while reading the request data. Consequently
it will never issue a close on its outgoing
stream. This results in my clients reader thread
never seeing EOF and so it will keep waiting
for data on the input stream forever.
Should I have mentioned that I am talking about
streaming data. I am not sending fixed sized
chunks back and forth.
Harald.
.
- 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
- Sockets, writing data and shutdownOutput
- Prev by Date: about org.eclipse.test.performance package
- Next by Date: Re: JProgressBar not displaying or updating (also on java.gui - sorry)
- Previous by thread: Re: Sockets, writing data and shutdownOutput
- Next by thread: Re: Sockets, writing data and shutdownOutput
- Index(es):
Relevant Pages
|