Integration of Socket communication with QNX send/receive/re

How does one integrate socket communication with QNX message passing?

I would like to create a application that blocks in a main Receive loop
until either a QNX message is received or a socket is ready. Can someone
provide an example of how this is accomplished.

Thanks,

Richard

“Brown, Richard” <brownr@aecl.ca> wrote in message
news:9ufrvs$234$1@inn.qnx.com

How does one integrate socket communication with QNX message passing?

I would like to create a application that blocks in a main Receive loop
until either a QNX message is received or a socket is ready. Can someone
provide an example of how this is accomplished.

take a look at ftp://ftp.qnx.com/usr/free/qnx4/tcpip/examples/selio.c.gz it
gives some hints.

Thanks,

Richard

// wbr

Use select to monitor socket traffic and _select_receive to handle QNX
messages “underneath” the select.

“Brown, Richard” wrote:

How does one integrate socket communication with QNX message passing?

I would like to create a application that blocks in a main Receive loop
until either a QNX message is received or a socket is ready. Can someone
provide an example of how this is accomplished.

Thanks,

Richard

Dean Douthat <ddouthat@faac.com> wrote:

Use select to monitor socket traffic and _select_receive to handle QNX
messages “underneath” the select.

That is one choice.

Another is to set your sockets to signal you when there is data to read
available on them, attach a signal handler that triggers a proxy when
that signal comes in, then write your receive loop as:

unblock_signal()
do
pid = Receive()
while (pid == -1 && errno == EINTR)
bock_signal()
if (pid = signal_proxy)
select()
else
handle_whatever()

Depends on whatever will give you a happier structure.

-David


“Brown, Richard” wrote:

How does one integrate socket communication with QNX message passing?

I would like to create a application that blocks in a main Receive loop
until either a QNX message is received or a socket is ready. Can someone
provide an example of how this is accomplished.

Thanks,

Richard


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