next up previous contents index
Next: 8.2.4 connect: initiate a Up: 8.2 oskit_socket: Socket Interface Previous: 8.2.2 accept: accept a

8.2.3 bind: bind a name to a socket

 

SYNOPSIS

#include <oskit/net/socket.h>

oskit_error_t oskit_socket_bind(oskit_socket_t *s, const struct oskit_sockaddr *name, oskit_size_t namelen);

DESCRIPTION

bind assigns a name to an unnamed socket. When a socket is created, it exists in a name space (address family) but has no name assigned. bind requests that name be assigned to the socket.

PARAMETERS

s
The socket to which a name is to be bound.

name
The name to which the socket is to be bound.

namelen
The length of name in bytes.

RETURNS

Returns 0 on success, or an error code specified in <oskit/error.h>, on error.



University of Utah Flux Research Group