Socket Programming for QNX

I want to port my linux source code to QNX. It uses sockets to dump data on a PC.
I compiled it code using
QCC source.c -lsocket -o source.exe
It compiles with no errors but when i run the client program the
connect() function calls fails…i cannot figure out why. the code runs perfectly well on the same machine when booted in linux…
am i missing on something basic like including any lib or something…
any help is highly appreciated.
regards
sachin

At least we need the QNX version, the error code come back from the connect() call, and best would be a sample source code…

For a wild guess, the “struct sockaddr” in Linux don’t have a sa_len member, but in QNX, this need to be filled in.