Gervais Mulongoy
|
Re: How to detecting the network down quickly?
|
Gervais Mulongoy
12/12/2011 9:51 AM
post90542
|
Re: How to detecting the network down quickly?
You're right - I wasn't considering network latency at all. So set the timeout to the highest observed network latency
(so if highest was <200ms then set the timeout to 200ms) or just set the timeout to 1 second and be safe.
|
|
|
y cheng
|
Re: How to detecting the network down quickly?
|
y cheng
12/12/2011 10:01 AM
post90543
|
Re: How to detecting the network down quickly?
Thanks a lot for your super fast response! Really appreciated you nice guys!
Yes, I can use mq_timedsend to send but the problem is the open(Which takes a 3-5 seconds to return a failure if a peer
PC is freezing). I have to open that message queue first, get a file descriptor, then use the file descriptor to do send
. Unfortunately, I can find a timed open() or a timed access() functions to test the existence of the remote message
queues :(.
I will try ifwatchd to detect when the cable is disconnected or when
the interface is brought down. Didn't use that before.
I am testing a hot swap application between two QNX PCs, upon one machine freezing, another PC takes over the task, that
is why I need to detect the failure very fast, otherwise, a lot of packets will be lost.
Yours
Jay
|
|
|