[3187] in java-interest

home help back first fref pref prev next nref lref last post

write on a closed socket

daemon@ATHENA.MIT.EDU (Anselm Baird_smith)
Thu Nov 2 17:21:51 1995

Date: Thu, 2 Nov 1995 20:17:47 +0100
From: Anselm Baird_smith <Anselm.Baird_Smith@inria.fr>
To: java-interest@java.sun.com
Reply-To: Anselm Baird-Smith <Anselm.BairdSmith@inria.fr>


Hi,

I just discovered a few new things:

a) Switching to beta (instead of pre-beta) solved half the problems
b) not using a PrintStream to write to a socket solved the other half.

on b) here is what I suspect (please do tell me if I am wrong):
PrintStream write like this:
     try {
         write...
     } catch(IOException e) {
     }

Fine, but what if the underlying output is a socket ? Looks like you
have a ticket to hell: every write on a single byte triggers an
IOException, this takes a lot of CPU, and than you know nothing about
your client being dead :-(

So, my conclusion is: Don't use PrintStream on top of Socket.

If this is not correct, please *let me know* !

Anselm.

-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post