C:bind
lastmod 2026-11-10created 2024-10-072 edits
bind is a Berkeley sockets API function that assigns a local address, such as an IP address and port number, to a socket. On the server side it is called with a descriptor created by socket, a sockaddr structure, and its length; it returns 0 on success and -1 on failure, setting errno. Connections are then accepted with listen and accept.