Sockets and proxies

Can I set up a (connected) socket for sending a proxy when something is
ready for reading ?

Reason for asking:

I’m working with a application that is supposed to communicate with message
queue and tcp-sockets. I’m looking at an existing program that does parts of
what I want, it communicates with message queues and a serial link. The
program flow is like:

initialize variables
set up a message queue, with a proxy
set up a timer, with a proxy
set up an interrupt handler, with proxy
main loop:
Receive(0, …)
Got a proxy, if pid is mq_px do something
else if pid is timer_px do something
else if pid is irq_px do something

I would like to use the existing program as a template but “replace” the
serial link part with a socket interface. I have programmed for QNX message
passing in the standard way waitng on a Receive() for something to happen
and for UNIX sockets waiting on a read(). But can I instead set up a
(connected) tcp-socket for sending a proxy when something is ready for
reading to trigger the process when it is waiting on a Receive()? Any
examples available?

Something like this?

initialize variables
set up a message queue, with a proxy
set up (connect) a tcp-socket, with a proxy
main loop:
Receive(0, …)
Got a proxy, if pid is mq_px do something
else if pid is tcp_px do something

Terje Trane <trane@systek.no> wrote:

Can I set up a (connected) socket for sending a proxy when something is
ready for reading ?

Check ftp://ftp.qnx.com/usr/free/qnx4/tcpip/examples/selio.*

That’s probably what you want.

-xiaodan

Reason for asking:

I’m working with a application that is supposed to communicate with message
queue and tcp-sockets. I’m looking at an existing program that does parts of
what I want, it communicates with message queues and a serial link. The
program flow is like:

initialize variables
set up a message queue, with a proxy
set up a timer, with a proxy
set up an interrupt handler, with proxy
main loop:
Receive(0, …)
Got a proxy, if pid is mq_px do something
else if pid is timer_px do something
else if pid is irq_px do something

I would like to use the existing program as a template but “replace” the
serial link part with a socket interface. I have programmed for QNX message
passing in the standard way waitng on a Receive() for something to happen
and for UNIX sockets waiting on a read(). But can I instead set up a
(connected) tcp-socket for sending a proxy when something is ready for
reading to trigger the process when it is waiting on a Receive()? Any
examples available?

Something like this?

initialize variables
set up a message queue, with a proxy
set up (connect) a tcp-socket, with a proxy
main loop:
Receive(0, …)
Got a proxy, if pid is mq_px do something
else if pid is tcp_px do something

Xiaodan Tang <xtang@qnx.com> wrote in message
news:8pogdl$mog$1@nntp.qnx.com

Check > ftp://ftp.qnx.com/usr/free/qnx4/tcpip/examples/selio> .*

That’s probably what you want.

Good grieves… I was hoping for something neater (and simpler),
but thanks.