Skip to main content

socket_bind

Discworld driver help

socket_bind

Name

socket_bind() - bind a name to a socket

Synopsis

#include <socket_errors.h>

int socket_bind( int s, int port );

Description

socket_bind() assigns a name to an unnamed socket. When a socket is created with socket_create() it exists in a name space (address family) but has no name assigned. socket_bind() requests that `port' be assigned to the socket `s'.

socket_bind() returns EESUCCESS on success, and a negative value indicated below on error.

Errors

These errors are in <socket_errors.h>:

EEFDRANGEDescriptor out of range.
EEBADFDescriptor is invalid.
EESECURITYSecurity violation attempted.
EEISBOUNDSocket is already bound.
EEADDRINUSEAddress already in use.
EEBINDProblem with bind.
EEGETSOCKNAMEProblem with getsockname.

See also

socket_connect(), socket_create(), socket_listen()