replying immediately, sending back an event later

We want to create server able to reply immediately for some functions
and send an event when the job is completed.

So the client has to send an event structure to initiate a special
behaviour in the server as keeping the rcvid for MsgDeliverEvent().
Right?

But I cannot exactly figure out how to do. Do I have to send first a
message for the request and then a message for the sigevent?
How the server receive a sigevent?

Regards,
Alain.

You can have the client send an _IO_NOTIFY message: something
like ionotify() or select(). To aid the server in handling
this message, you can look at iofunc_notify() and
iofunc_notify_trigger().


Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:
: We want to create server able to reply immediately for some functions
: and send an event when the job is completed.

: So the client has to send an event structure to initiate a special
: behaviour in the server as keeping the rcvid for MsgDeliverEvent().
: Right?

: But I cannot exactly figure out how to do. Do I have to send first a
: message for the request and then a message for the sigevent?
: How the server receive a sigevent?

Usually you send the _IO_NOTIFY first. You can use _NOTIFY_ACTION_POLLARM
for the action. If the server returns that the condition is met
immediately, the client can make the real request immediately. This is
what select() does.

-seanb

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

We want to create server able to reply immediately for some functions
and send an event when the job is completed.

So the client has to send an event structure to initiate a special
behaviour in the server as keeping the rcvid for MsgDeliverEvent().
Right?

But I cannot exactly figure out how to do. Do I have to send first a
message for the request and then a message for the sigevent?
How the server receive a sigevent?

The client can do something like:

struct msg
{
int request_type;
struct req_data req_data;
struct sig_event event;
}

Then fill in the event structure and rest of the message, and send
it off to the server.

The server will look at the request type, save away the rcvid & the
event structre, reply that it will work on it… and go to work.

Later, when the work is done, the server just does a
MsgDeliverEvent( rcvid, &event);

-David

QNX Training Services
dagibbs@qnx.com