#include <rtl.h>
int bind (
int sock, /* Socket descriptor */
const SOCKADDR *addr, /* Pointer to the local address */
int addrlen); /* Length of the SOCKADDR structure */
Description
The bind function assigns a name to an unnamed socket. The
name represents the local address and port of the
communication end point.
The argument sock specifies a socket descriptor returned
from a previous call to socket.
The argument addr is a pointer to the SOCKADDR structure
containing the local address and port of the socket.
The argument addrlen specifies the length of the SOCKADDR
structure.
The bind function is in the RL-TCPnet library. The
prototype is defined in rtl.h.
note
You must call the socket function before any other
function calls to the BSD socket.
If a negative number is returned, it represents an error
code.
Return Value
The bind function returns the result code:
SCK_SUCCESS
The function call is successful.
SCK_EINVALID
The socket identified with sock is invalid.
SCK_EINVALIDPARA
The function parameters are invalid or not supported.
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.