NIO Timeout

K

Kam

Hi,
my question is probably stupid, but i can't figure any solution.

I'm developping a Xml Server with non-blocking NIO.
In other words, I have a single Thread that listens all clients for
requests.

My question is : is there a SIMPLE solution to fire timeout event after some
time of inactivity for a client ?
With java.net and blocking socket, Socket.setTimeout was fine, but it
doesn't apply to NIO.

Is there a way, or will I have to save a timestamp for every client, and
check over time for long periods without activity ?

Thanks for your answer(s), and sorry for my crap english : I'm french and,
as every french, bad in foreign languages :)

Kam
 

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

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top