|const struct sockaddr * addressPtr,|
tfBindNoCheck() assigns an address to an unnamed socket. When a socket is created with socket, it exists in an address family space but has no address assigned. tfBindNoCheck() requests that the address pointed to by addressPtr be assigned to the socket. Clients do not normally require that an address be assigned to a socket. However, servers usually require that the socket be bound to a "well known" address. The port number must be less than 32,768 (TM_SOC_NO_INDEX), or could be 0xFFFF (TM_WILD_PORT). Binding to the TM_WILD_PORT port number allows a server to listen for incoming connection requests on all the ports. This function is similar to bind(), except that bind() checks that the address that the user wants to bind to is a valid configured address on an interface; tfBindNoCheck() does not check for that, and allows the user to bind to any IP address.
- (int) socketDescriptor
- The socket descriptor to assign an IP address and port number to.
- (const struct sockaddr *) addressPtr
- The pointer to the structure containing the address to assign.
- (int) addressLength
- The length of the address structure.
|Note:|| TM_SOCKET_ERROR means that this socket call has failed and the errorCode has been set on the socket itself.
To retrieve the socket error the user must call tfGetSocketError(socketDescriptor).
Possible socket errors
- The specified address is already in use.
- 'socketDescriptor' is not a valid descriptor.
- One of the passed parameters is invalid, or the socket is already bound.
- tfBindNoCheck() is already running.