Andrew Boyd(deleted)
|
RE: RE: QNET node detection
|
Andrew Boyd(deleted)
01/28/2009 10:00 AM
post20923
|
RE: RE: QNET node detection
Assuming that you are modifing the
source code to (lwl4) qnet ...
Look at qos/qos_init.c ... you can
see it calling ndb_change_register()
to which it passes a callback function
(of the qos layer) called nd_change_notify()
which is also located in qos_init.c
So, if I were you, I would just hook
into nd_change_notify(), which is called
by the NDB when something happens in the
node database.
The first parameter of nd_change_notify()
is status. EHOSTDOWN means a node has
gone down. EOK means a node has gone up.
For both of these cases, I would simply
trigger a pulse (which had been previously
passed to qnet) using a non-blocking kernel
call like MsgDeliverEvent(). This pulse
would wake up a thread of an external process
which is receive-blocked, waiting for the
ndb-change pulse.
Please don't make a blocking call in
nd_change_notify().
--
aboyd
-----Original Message-----
From: rajesh k [mailto:community-noreply@qnx.com]
Sent: Wednesday, January 28, 2009 9:48 AM
To: technology-networking
Subject: Re: RE: QNET node detection
Hi aboyd,
i am also looking for this.
can u provide exactly what kind of event will occur when node goes up or
down.
Is this correct way am approaching
register a "my_nd_change" call back funtion in qnet to get the nd
change.
ndb_change_register(5, my_nd_change, 0);
_
Thanks,
Raj
_______________________________________________
Technology
http://community.qnx.com/sf/go/post20921
|
|
|