Re: Sockets, writing data and shutdownOutput



> 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...


.



Relevant Pages

  • Re: Tired of 100s of stupid Getter/Setter methods
    ... > reading the documentation that the library developer wrote. ... ability to become familiar with an API. ... Given the choice between finding out about a bug as I'm writing the ... say about a language that's one of the more readable that I work in. ...
    (comp.lang.java.programmer)
  • Re: What is QWPZHPT1 ??
    ... now it's V5.3 and the bug is still there. ... I also have had many customer complain about this with HPT printers and using software that uses the HPT API. ... Similar reports work just fine. ... The only thing I could think of is if there was some bad data in the report somewhere, but I never found any (must be that CPYSPLF removed the bad data if there was any). ...
    (comp.sys.ibm.as400.misc)
  • MSP 2000/2002/2003 VBA API Bug - View and Table switching
    ... Bug #1 - API parameter values are language specific ... There seems to be a serious limitation in all MSP versions that prohibits ... The problem is that MSP API requires English strings such as "Gantt ... Bug #2 - Application.EditTable and other methods in this category require ...
    (microsoft.public.project.vba)
  • Re: fix iounmap and a pageattr memleak (x86 and x86-64)
    ... I'd never use a 32bit kernel on a x86-64 box, ... interest bug to me, but acked. ... API, I'm not going to care if you want it back, but if there are 3 ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: Exit button, but data are not saved ?!
    ... I couldn't respond to you sooner, but I am closing the ... form and not hiding it. ... So I will check out this bug then, ... rather than allenbrowne at mvps dot org. ...
    (microsoft.public.access.forms)