[601] in java-interest

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

serverInput.read blocking with 0 bytes to read...

daemon@ATHENA.MIT.EDU (Gary Joseph Bowdridge)
Thu Jul 6 13:20:30 1995

From: grover@ra.isisnet.com (Gary Joseph Bowdridge)
To: java-interest@java.Eng.Sun.COM
Date: Thu, 6 Jul 1995 06:47:20 -0300 (ADT)

ok.. Bare with me. I'm new to the ideas of OO. and new to Java..
but catching on.

I open a new NetworkClient connection to a host  
    client=new NetworkClient(telnethost,telnetport);

I check to see how much data is in the input stream
      numthere=client.serverInput.available();

I proceed to read that data
      client.serverInput.read(telnetline,0,numthere);

Now, i would assume that when "numthere" is "0" (as it seems to be often)
client.serverInput.read would NOT block waiting to read "0" bytes from
a stream with "0" bytes waiting to be read.. tho that seems to be the
case.... If numthere=0 the applet hangs at the read...

  It was easily fixed by first checking to see if "numthere > 0" 
before doing the read...   

  Am i doing something wrong with my read?

Better yet.. is there a NON-Blocking input/output stream implemented?
i didn't seem to see anything of the sort (*new to java*).

___
grover@ra.isisnet.com (Gary Bowdridge).

-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

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