Will rcvid change at run time?

If the SAME client send message to the server at different time, will the
rcvid correspond to that client changes at runtime?

while(1)
{
rcvid=MsgReceive(…);
}


()=()=()=()=()=()=()=()=()
^_^!
I ask because I am a novice.
()=()=()=()=()=()=()=()=()

Shirley <novice@hongkong.com> wrote:

If the SAME client send message to the server at different time, will the
rcvid correspond to that client changes at runtime?

Depends on how you identify “same” client. If two different threads in
the same process send to the server at different times, (or same time)
they would get different rcvids – but if it is the same thread from
the same process it should have the same rcvid.

rcvid effectively identifies a particular SEND block thread.
scoid basically identifies a particular client process

Both rcvid and scoid could (will) get re-used for different processes,
that is, if a client talks to server, then this client goes away, then
a new client talks to the server, this new client could (will) get the
same rcvid as the previous client, so you can’t assume that same
rcvid means same client.

That is:

if client is same (thread & pid) → rcvid is same
NOT { if rcvid is same → client is same }

If you are keeping rcvids around, you should request client disconnect
notification (_NTO_CHF_DISCONNECT) and store scoids with that, then
cleanup (mark as old/dead) any rcvid(s) associated with the client
(scoid) that went away.

-David

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

David, is there a way to get client disconnect notification in an io-net
module? I can message_attach(), using io-net’s dpp, and get a request from a
client, but I haven’t found a way to tell if he dies before I can answer him.

Murf

David Gibbs wrote:

Shirley <> novice@hongkong.com> > wrote:
If the SAME client send message to the server at different time, will the
rcvid correspond to that client changes at runtime?

Depends on how you identify “same” client. If two different threads in
the same process send to the server at different times, (or same time)
they would get different rcvids – but if it is the same thread from
the same process it should have the same rcvid.

rcvid effectively identifies a particular SEND block thread.
scoid basically identifies a particular client process

Both rcvid and scoid could (will) get re-used for different processes,
that is, if a client talks to server, then this client goes away, then
a new client talks to the server, this new client could (will) get the
same rcvid as the previous client, so you can’t assume that same
rcvid means same client.

That is:

if client is same (thread & pid) → rcvid is same
NOT { if rcvid is same → client is same }

If you are keeping rcvids around, you should request client disconnect
notification (_NTO_CHF_DISCONNECT) and store scoids with that, then
cleanup (mark as old/dead) any rcvid(s) associated with the client
(scoid) that went away.

-David

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

John A. Murphy <murf@perftech.com> wrote:

David, is there a way to get client disconnect notification in an io-net
module? I can message_attach(), using io-net’s dpp, and get a request from a
client, but I haven’t found a way to tell if he dies before I can answer him.

I’m not great at the internals of io-net – you might try asking this
in qdn.public.ddk.network.

I’m guessing, since you’re calling message_attach() with io-net’s dpp,
that io-net has created the channel, and will be handling the client
departure notification – io_close/io_close_ocb – but I don’t know if
allows different modules to hook into this or not.

Of course, if you created your own channel/registered your own name,
and ran your own dispatch loop, you could get that notification – but
you may not want to do that.

-David

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

Yeah, I’ve considered that, but it doesn’t seem like “the QNX way” to attack the
problem. But thanks for the input!

Murf

David Gibbs wrote

Of course, if you created your own channel/registered your own name,
and ran your own dispatch loop, you could get that notification – but
you may not want to do that.

-David

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

David Gibbs <dagibbs@qnx.com> wrote in message
news:b54q67$i4$1@nntp.qnx.com

John A. Murphy <> murf@perftech.com> > wrote:
David, is there a way to get client disconnect notification in an io-net
module? I can message_attach(), using io-net’s dpp, and get a request
from a
client, but I haven’t found a way to tell if he dies before I can answer
him.

I’m not great at the internals of io-net – you might try asking this
in qdn.public.ddk.network.

I’m guessing, since you’re calling message_attach() with io-net’s dpp,
that io-net has created the channel, and will be handling the client
departure notification – io_close/io_close_ocb – but I don’t know if
allows different modules to hook into this or not.

I believe this is the case.

The default resmgr library handled this part. The disconnect pulse go into
the channel, and it will be translated into an _IO_CLOSE, pass to the
server.

-xtang