Eric Norton <email@example.com> wrote:
I’m using the resource manager framework using the dispatch block with the
associated attach functions and I’m porting (from QNX4) a server that
communicates over sockets (it accepts the connections). What’s the best way
to accept connections and read/write on a socket in this framework? I’m
aware of select_attach for reading on a particular fd, but with socket
communication you don’t have your fd until you accept a connection which
would be after you’ve set everything up. It looks like this is not the best
framework to use in the application.
Actually, if I remember my TCP/IP properly – you have to create a socket,
and bind() that socket to an IP address, then listen() on it.
Then, you should be able to select() on that socket to know if there are
any incoming requests – that would be a select_attach() on the first
socket. Inside that handler, you would accept() the connection (getting
a new socket), for which you would, again, do a select_attach() to handle
Or, create a seperate thread to handle the TCP/IP side of things within
the resource manager framework. Might be more efficient, and an easier
Please follow-up to newsgroup, rather than personal email.
QNX Training Services