Does BufferedReader readLine block

A

Angus

I am in a loop checking any input and I don't want readLine to block.

Is there a non blocking function or a way to chekc if any data has come in?

Angus
 
G

Gordon Beaton

I am in a loop checking any input and I don't want readLine to
block.

Is there a non blocking function or a way to chekc if any data has
come in?

Input from *where*? Whether readLine blocks or not depends entirely on
the behaviour of the underlying stream.

Have a look at java.nio.channels.Selector.

/gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,270
Messages
2,571,102
Members
48,773
Latest member
Kaybee

Latest Threads

Top