About MsgDeliverEvent()....

If I look at the example in the doc, the client allocates a sigevent
structure, initialize it and send it to the server.
But in fact, the sigevent isn’t really usefull for the client.

Should it be possible to only send the pulse code value, optionally the
value, and let the server allocating the sigevent structure and filling
it like that:


MsgInfo(ctp->rcvid, &msg_info); // necessary to know who eventually
wants to lock a record
event = malloc(sizeof(struct sigevent));
SIGEV_PULSE_INIT( &event, msg_info.coid, msg_info.priority,
sended_pulse_code, sended_value);



If I ask the question it’s because that doesn’t work :wink:.
Maybe I get confused with the connection id I pick up in the msg_info
structure.

What’s wrong?

Thanks,

Alain.

Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:

If I look at the example in the doc, the client allocates a sigevent
structure, initialize it and send it to the server.
But in fact, the sigevent isn’t really usefull for the client.

Should it be possible to only send the pulse code value, optionally the
value, and let the server allocating the sigevent structure and filling
it like that:


MsgInfo(ctp->rcvid, &msg_info); // necessary to know who eventually
wants to lock a record
event = malloc(sizeof(struct sigevent));
SIGEV_PULSE_INIT( &event, msg_info.coid, msg_info.priority,
sended_pulse_code, sended_value);

This won’t work – the coid in the sigevent structure must be a
connection to the person going to receive the pulse, to the client.

The msg_info.coid is the client’s connection to the SERVER.

Also, the intention is that the server doesn’t know, or care,
whether the client wants a pulse, signal, or some other form
of notification – only the client knows that. The server doesn’t
need to know, or modify, the contents of the sigevent.

-David

QNX Training Services
I do not answer technical questions by email.

David Gibbs a écrit :

Alain Bonnefoy <> alain.bonnefoy@icbt.com> > wrote:
If I look at the example in the doc, the client allocates a sigevent
structure, initialize it and send it to the server.
But in fact, the sigevent isn’t really usefull for the client.

Should it be possible to only send the pulse code value, optionally the
value, and let the server allocating the sigevent structure and filling
it like that:


MsgInfo(ctp->rcvid, &msg_info); // necessary to know who eventually
wants to lock a record
event = malloc(sizeof(struct sigevent));
SIGEV_PULSE_INIT( &event, msg_info.coid, msg_info.priority,
sended_pulse_code, sended_value);

This won’t work – the coid in the sigevent structure must be a
connection to the person going to receive the pulse, to the client.

The msg_info.coid is the client’s connection to the SERVER.

Also, the intention is that the server doesn’t know, or care,
whether the client wants a pulse, signal, or some other form
of notification – only the client knows that. The server doesn’t
need to know, or modify, the contents of the sigevent.

-David

QNX Training Services
I do not answer technical questions by email.

Ok David, I understand that!
Just one precision, I didn’t really understand the meanning of
msg_info.scoid.
Could you tell me some words about it?

Thanks,
Alain.

Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:

David Gibbs a ecrit :



Ok David, I understand that!
Just one precision, I didn’t really understand the meanning of
msg_info.scoid.
Could you tell me some words about it?

It is a server-side identifier for the client. You can, kind of,
think of it as the “server connection id”, identifying the server
side of the connection from that particular client – but it is
unique per client, not per connection from a client.

So:

msg_info.scoid - a particular client nd/pid combination
rcvid - a particular REPLY blocked thread – i.e. nd/pid/tid
msg_info.coid - the client’s coid to us
msg_info.scoid & msg_info.coid together uniquely identify the client
connection. scoid says which client, coid says within that client,
which connection (as the client may have multiple connections to us).
For instance, this combination is used by the resmgr library to determine
which OCB structure to find for incoming IO messages.

-David

QNX Training Services
I do not answer technical questions by email.