Listen to standby, wake up event

J

Juergen Kraus

Hi,

is there a way to listen to standby and wake up events with java programs.

We have a client application that sends periodically alive events to the
server. In standby or power save mode these events cannot be sent and
therefore our server terminates the session.
It would be nice to send events from the client to the server just before
switching to standby and shortly after waking up.

Do you have any tips to solve this problem?
Thank you!

Juergen
 
G

Gordon Beaton

is there a way to listen to standby and wake up events with java
programs.

We have a client application that sends periodically alive events to
the server. In standby or power save mode these events cannot be
sent and therefore our server terminates the session. It would be
nice to send events from the client to the server just before
switching to standby and shortly after waking up.

Do you have any tips to solve this problem?

I would suggest that your client should simply reconnect to the server
whenever it detects that the connection has been lost. Any distributed
application that hopes to be robust should do that anyway.

If your connections are stateful, the server should remember the state
of the client it disconnected. Upon reconnecting, the client can
request that the previous state (if any) be resumed, otherwise the
server can discard the saved state at that point.

Another idea is that you should be able to detect wakeup without
outside help. If you note the time you send each alive event, and
discover that the previous one was "long ago", then you can assume
that you've been asleep for the interim.

/gordon
 
J

Juergen Kraus

Hi Gordon,

thank you for your answer.

The problem is, that our server is not able to distinguish between clients
in standby mode and crashed clients. In both cases the client is dead an no
messages can be send to it.

A client opens a document and the server locks this document until it is
closed by the client. It is very important that a document is only edited
by one user at a time. Therefore we must be able to check if the client is
dead. If it is dead the server is able to unlock the open document.

Perhaps we should write some C program that listens to shutdown, standby
events at the client and forwards those events to the server.

Juergen
 
G

Gordon Beaton

The problem is, that our server is not able to distinguish between
clients in standby mode and crashed clients. In both cases the
client is dead an no messages can be send to it.

A client opens a document and the server locks this document until
it is closed by the client. It is very important that a document is
only edited by one user at a time. Therefore we must be able to
check if the client is dead. If it is dead the server is able to
unlock the open document.

Perhaps we should write some C program that listens to shutdown,
standby events at the client and forwards those events to the
server.

If the client is holding a lock on a resource owned by the server, it
could be argued that the server should consider that a non-responsive
client is dead (regardless of the reason) and retract the lock. The
client can discover this fact when he wakes up and contacts the server
before continuing.

On the other hand if you can write C to listen to those events, you
should be able to write some native methods using JNI to notify your
client from within the application.

/gordon
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top