Re: Sockets, writing data and shutdownOutput
- From: "jan V" <nul@xxxxxx>
- Date: Tue, 02 Aug 2005 19:58:32 GMT
> 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.
Yep, OK, the Sun source code proves you're right. But my app worked like a
dream... I'd have to go look at *my* source to see precisely what traffic
scenario I subjected my various Sockets to, but all I can say is that I used
the close() API as (then) advertised, and it worked (clearly I can't have
been relying on any stuff coming back via the input stream...). Obviously I
was just a few nanometers away from stepping on yet another bug in Sun's
APIs.
On a software engineering note, this just goes to highlight yet again that
the vast majority of managers completely fail to invest enough resources to
ensure that QUALITY (incl. low defects) is produced before launching some
library API into the big bad world. The above example is one of so many
where the original authors now face the dillema of "Shall we fix this, and
thus break thousands of applications that relied on this flaw, or shall we
leave the flaw as is to maintain backward compatibility?" Either way, the
situation is very messy. The only solution to this is to invest more time
and resources in PREVENTING such bugs creeping in in the first place...
.
- Follow-Ups:
- Re: Sockets, writing data and shutdownOutput
- From: Thomas Hawtin
- 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
- Re: Sockets, writing data and shutdownOutput
- From: HK
- Sockets, writing data and shutdownOutput
- Prev by Date: Re: A valid question?
- Next by Date: Re: ANN. SimpleTemplate - Template Engine for java
- Previous by thread: Re: Sockets, writing data and shutdownOutput
- Next by thread: Re: Sockets, writing data and shutdownOutput
- Index(es):
Relevant Pages
|