By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,557 Members | 1,164 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,557 IT Pros & Developers. It's quick & easy.

Is it possible to timeout some thread which expecting read io event? [java.nio]

P: n/a
with java.nio package,
we can process non-blocking io operation.

But I cannot know how timeout IO operation in non blocking mode.
By selector mechanism,

I wrote REQ message to some socketchannel and expect read event.
Usually I get readevent and get RSP message in good time.(Good Case)
but sometime I don't get readevent in time.(Error Case)
In this case, I wish to throw exception. How can I this?
In blocking mode, I does this by socket.setSoTimeout(..) but in 1.4, how?

Any advices will help me.
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.