I’m porting a client/server system from windows to qnx (windows client, qnx
but am having difficulties getting the two to talk!
The server (qnx) sucessfully opens a socket, binds it to the nic on a
listens() and blocks on accept();
It actually doesn’t bind to a “nic”. It binds to a port. Depending
on how you bind, your machine config, and your network config its
possible that traffic will only come in over one NIC but thats not
necessarily true now nor even if its true now does it have to be true
over the runtime of the server.
the client (windows) opens a socket and tries to connect to the server, but
WSACONNREFUSED (refused connection) from the server… but the server
is listening and wants to connect
Now, as a newbie to qnx (and *nixy type things) my question is:
Do I have to specify the port I am using in one of the /etc files?
Probably not. There are two issues. One is defining the port of a
well defined service. Thats what /etc/services is for. Unless you
are looking up this service you are providing you don’t need to modify
/etc/services. The other is actually binding to the correct port.
I’d guess thats where your problem is.
The question I would ask is what port is the server bind()ng to
(‘netstat -an’  is your friend) and what port is the windows machine
trying to connect to. I’d guess you probably didn’t ntohs() the port
before bind()ng to it and the server is bound to 0xCDAB while the
server is connecting to 0xABCD. How you figure out what the windows
side is doing the equivalent of a connect() to is unknown to me.
 In fact ‘netstat’ is your friend in all unix TCP/IP work. Learn
its options. Twiddle its knobs. It’ll pay you back in multiples.