Bind a name to a socket
#include <sys/types.h> #include <sys/socket.h> int bind( int s, const struct sockaddr * name, socklen_t namelen );
Use the -l socket option to qcc to link against this library.
When a socket is created with socket(), it exists in a namespace (address family) but has no name assigned to it. The bind() function assigns a name to that unnamed socket.
|The bind() function assigns a local address. Use connect() to assign a remote address.|
The rules used for binding names vary between communication domains.
|Before calling bind() on an AF_INET socket, set the af_family member of the sockaddr structure to AF_INET. Up until QNX Neutrino 6.4.0, a value of 0 was accepted and assumed to be this value.|
ICMP, IP, TCP, and UDP protocols
connect(), getpeereid(), getsockname(), listen(), socket()