Hi,
I have a Java application which runs a server socket on a PC. Various
sensors (using microprocessors) can call it up and each gets its own thread
running the socket connection.
The sensors send in data at random times. This all works OK.
Sometimes one of the sensors fails or goes off-line. How can I tell from
the server end? If they fail I would like to close the link down.
Obviously I could poll links on a periodic basis and mark the link as dead
after a specified timeout but this seems rather inelegant. If I chose a
short period the network might be very busy for a short time and cause a
false timeout. If the period is long then I either have to start a new
thread to handle the polling or elselive with my main application blocking.
Anyway, there might be several hundred sensors and I don't want to clutter
the network up with polling packets. Is there a better way?
I would be grateful for any help.
Regards,
Nick