Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to determine that an input stream (or a socket) is breaken?


  • From: wang-xizhen@xxxxxxx (Xizhen Wang)
  • Subject: How to determine that an input stream (or a socket) is breaken?
  • Date: Wed, 29 Sep 1999 19:57:30 +0800

Hi! all,

In java, how to determine that an input stream (or a socket) is broken?
I use a BufferedReader (i.e. in) to read from this stream, and when
in.readline() == null, I understand the connection is broken. Does that
make sense on NT and Solaris? Or is there a better way to do that?

Is there a sample code or a way to do this?
1. Keep the socket connection open.
2. read from the input stream whenever there is new data coming in.
(3. the reading thread is blocked when there is not no new data. or at
least does not occupy big CPU time for looping)

Can anyone give me a hand? Help is needed urgently.

Thank you!
Xizhen

---
To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx