Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - QNET node detection: (10 Items)
   
QNET node detection  
Hi,

Is there a way for application to get a notification when a qnet node is entering or leaving the qnet cluster within the
 same network?  We only have 2 qnet nodes in the same subnet.

-Wilson
RE: QNET node detection  
I can't think of any ... One simple way would be to have an 
application, which woke up every 15 seconds (or so) and
did a read_dir of /net to see if anything new had appeared.
 
Not sure if this would be fast enough for your purposes.
 
A much slicker way would be to add support to qnet to
allow a client to register a pulse, which would be kicked
when there was an ndb node up/down event.
 
You could either code this up yourself - all the source to
qnet is on the foundry - or you could ask Rob Craig to have
it added to the roadmap.
 
--
aboyd
 

________________________________

From: Wilson Talaugon [mailto:community-noreply@qnx.com]
Sent: Fri 1/16/2009 6:10 PM
To: technology-networking
Subject: QNET node detection



I 

 

 


Is there a way for application to get a notification when a qnet node is entering or leaving the qnet cluster within the
 same network?  We only have 2 qnet nodes in the same subnet.

-Wilson

_______________________________________________
Technology
http://community.qnx.com/sf/go/post20274



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
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
Re: RE: RE: QNET node detection  
Hi Andrew,

How can qnet send a pulse to the external process (subscriber) unless the extenal process must first send a pulse to 
qnet.  Does this mean that the external process must first subscribe to the node event by sending a pulse to qnet?

Can you give us some pointers how qnet can send a pulse to a particular external process.

RE: RE: RE: QNET node detection  
I'm not sure I understand your question ... I think
this is probably what you want to use:

http://www.qnx.com/developers/docs/6.4.1/neutrino/lib_ref/m/msgsendpulse
.html

--
aboyd
Re: RE: RE: RE: QNET node detection  
What I meant in my previous posting is that if I were to add some code  in qnet to send a pulse within the callback 
notification I need to know which process to send the pulse to.  

One way I can do this is for QNET to create a channel to receive a pulse from application process.  Application process 
just need to figure out the QNET channel ID to send the request.  When QNET receives the pulse from the application 
process it stores the application process channel information.  When the callback notification is called it sends the 
pulse to the application process.

Let me know if this is the right approach.
RE: RE: RE: RE: QNET node detection  

> -----Original Message-----
> From: Wilson Talaugon [mailto:community-noreply@qnx.com]
> Sent: June-23-09 4:31 PM
> To: technology-networking
> Subject: Re: RE: RE: RE: QNET node detection
> 
> What I meant in my previous posting is that if I were to add some code
> in qnet to send a pulse within the callback notification I need to know
> which process to send the pulse to.
> 

The real method would be for qnet to support io_notify()

> One way I can do this is for QNET to create a channel to receive a
> pulse from application process.  Application process just need to
> figure out the QNET channel ID to send the request.  When QNET receives
> the pulse from the application process it stores the application
> process channel information.  When the callback notification is called
> it sends the pulse to the application process.
> 
> Let me know if this is the right approach.
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post32364
> 
RE: RE: RE: RE: QNET node detection  
Mario is correct. The right place to do this, is make /net support
io_notify().

If you intend to modify QNET, look into kif/path.c, path_init() where
"path_read()", "path_msg()" functions get hookup. You want to hook up
your own path_notify() function.

-xtang

> -----Original Message-----
> From: Mario Charest [mailto:community-noreply@qnx.com]
> Sent: June 23, 2009 4:36 PM
> To: technology-networking
> Subject: RE: RE: RE: RE: QNET node detection
> 
> 
> 
> > -----Original Message-----
> > From: Wilson Talaugon [mailto:community-noreply@qnx.com]
> > Sent: June-23-09 4:31 PM
> > To: technology-networking
> > Subject: Re: RE: RE: RE: QNET node detection
> >
> > What I meant in my previous posting is that if I were to add some
code
> > in qnet to send a pulse within the callback notification I need to
know
> > which process to send the pulse to.
> >
> 
> The real method would be for qnet to support io_notify()
> 
> > One way I can do this is for QNET to create a channel to receive a
> > pulse from application process.  Application process just need to
> > figure out the QNET channel ID to send the request.  When QNET
receives
> > the pulse from the application process it stores the application
> > process channel information.  When the callback notification is
called
> > it sends the pulse to the application process.
> >
> > Let me know if this is the right approach.
> >
> > _______________________________________________
> > Technology
> > http://community.qnx.com/sf/go/post32364
> >
> 
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post32365
RE: RE: RE: RE: QNET node detection  
I'm pretty sure I created a PR to add this feature
to qnet a while ago - external notification API
during node up/down.

Unfortunately even protocol support (even for enormous
customers)is a pretty low priority these days, and 
protocol enhancements simply aren't happening any
more.

--
aboyd