Interruptible I/O for ObjectInputStream

J

John English

Folks,
Can anyone tell me how to set matters up so that an ObjectInputStream
(connected to a socket) can be made to time out if nothing is available
to be read within a specified timeout period?

I'm using 1.4.2, BTW.

TIA,

----------------------------------------------------------------------
John English | mailto:[email protected]
Senior Lecturer | http://www.it.bton.ac.uk/staff/je
School of Computing & MIS | "Those who don't know their history
University of Brighton | are condemned to relive it" (Santayana)
----------------------------------------------------------------------
 
A

Antti S. Brax

Can anyone tell me how to set matters up so that an ObjectInputStream
(connected to a socket) can be made to time out if nothing is available
to be read within a specified timeout period?

Have you tried Socket.setSoTimeout(int)?
 
J

John English

Antti said:
Have you tried Socket.setSoTimeout(int)?

Ah, of course -- silly me, I was worrying about the ObjectInputStream and
had forgotten that I can time out the socket...

Many thanks.

----------------------------------------------------------------------
John English | mailto:[email protected]
Senior Lecturer | http://www.it.bton.ac.uk/staff/je
School of Computing & MIS | "Those who don't know their history
University of Brighton | are condemned to relive it" (Santayana)
----------------------------------------------------------------------
 

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
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top