Wake up a client

Suppose I use a while loop to let server keep on receiving from and replying
message to its clients.

If the server ignore the worker1’s Msgsend( ) in the 1st loop and let
client1 enter the block state, and server keep on receiving other Msgsend()
by other clients in the following loop, how can the server “wake up” client1
again latter?

Since client1 is already in block state, it won’t be able to send signal to
server again. Even the server implement MsgReceive() in next loop, it won’t
receive signal from client1…


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

The simple answer is: “Don’t ignore messages” :slight_smile:

The not so simple answer is to store the “rcvid” of the client (handle
returned by MsgReceive()) in your application somewhere before
restarting the loop. When you’re ready (depends on why you had to ignore
the message), you can fetch the stored rcvid and use it to reply.

Just curious, but why are you making your own message loop instead of
using the resource manager framework (ie. dispatch_, resmgr_, etc…)?

Daryl Low

Shirley wrote:

Suppose I use a while loop to let server keep on receiving from and replying
message to its clients.

If the server ignore the worker1’s Msgsend( ) in the 1st loop and let
client1 enter the block state, and server keep on receiving other Msgsend()
by other clients in the following loop, how can the server “wake up” client1
again latter?

Since client1 is already in block state, it won’t be able to send signal to
server again. Even the server implement MsgReceive() in next loop, it won’t
receive signal from client1…


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

Oh…^0^ because this is my first time in doing real time programming
assignment. And tutor has provided us with a rough template using while
loop.

Thx a lot.
“Daryl Low” <dlo*w@qnx.com> ¼¶¼g©ó¶l¥ó·s»D:3E6F0CB5.3090001@qnx.com

The simple answer is: “Don’t ignore messages” > :slight_smile:

The not so simple answer is to store the “rcvid” of the client (handle
returned by MsgReceive()) in your application somewhere before
restarting the loop. When you’re ready (depends on why you had to ignore
the message), you can fetch the stored rcvid and use it to reply.

Just curious, but why are you making your own message loop instead of
using the resource manager framework (ie. dispatch_, resmgr_, etc…)?

Daryl Low

Shirley wrote:
Suppose I use a while loop to let server keep on receiving from and
replying
message to its clients.

If the server ignore the worker1’s Msgsend( ) in the 1st loop and let
client1 enter the block state, and server keep on receiving other
Msgsend()
by other clients in the following loop, how can the server “wake up”
client1
again latter?

Since client1 is already in block state, it won’t be able to send signal
to
server again. Even the server implement MsgReceive() in next loop, it
won’t
receive signal from client1…


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