timeout without blocking thread
1 posts in topic
Flat View  Flat View

Posted By:   silvia_antunes
Posted On:   Friday, September 6, 2002 07:59 AM

if I use setSoTimeout() before socket.receive() does the thread block?

I need to wait for datagram packets during a certain time, but I have other threads running at the same time.

Re: timeout without blocking thread

Posted By:   Zac_Jacobson  
Posted On:   Tuesday, September 10, 2002 03:18 PM

Yes, if you are using the read() methods of an InputStream, it will block until data is ready or the timeout is reached.

Look at the java.nio package if you want non-blocking I/O.

About | Sitemap | Contact