how to handle when the client is dead by losing power.

bridged with qdn.public.qnxrtp.applications
Post Reply
ran zhang

how to handle when the client is dead by losing power.

Post by ran zhang » Thu Feb 14, 2002 3:28 pm

I got a server and client, the server is using select function to
determine if the client is terminated, or the connection is lost..
but it doesnt handle when client lost power, the server simply freezes til
the client's machine is backup, then select function
is able to tell that client is terminated... How do i make the server to
detect Client lost power rather than got frozen?

Adam Mallory

Re: how to handle when the client is dead by losing power.

Post by Adam Mallory » Fri Feb 15, 2002 2:56 pm

"ran zhang" <rzhang@vamcointernational.com> wrote in
news:a4gkuu$9mu$1@inn.qnx.com:
I got a server and client, the server is using select function to
determine if the client is terminated, or the connection is lost..
but it doesnt handle when client lost power, the server simply freezes
til the client's machine is backup, then select function
is able to tell that client is terminated... How do i make the server
to detect Client lost power rather than got frozen?
The best way is to setup a heart beat mechanism using out of band data.
Each time you get a heart beat you can reset a counter to zero. At a
certain tolerance point (say 5 missed heart beats) you can close off the
socket/clean up. Take a look at Steven's book on UNIX Network programming
Vol I, or try a google search for examples on clients and servers doing
this.



--
Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]
---------------------------------------------------
With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
--Peter J. Schoenster <pschon@baste.magibox.net>

David Gibbs

Re: how to handle when the client is dead by losing power.

Post by David Gibbs » Fri Feb 15, 2002 7:01 pm

Adam Mallory <amallory@qnx.com> wrote:
Take a look at Steven's book on UNIX Network programming
Vol I,
ISBN: 0-13-490012-X

Another good book by W. Richard Stevens.

-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Post Reply

Return to “qdn.public.qnxrtp.applications”