MPD  0.20.15
Functions
SocketUtil.hxx File Reference

Go to the source code of this file.

Functions

int socket_bind_listen (int domain, int type, int protocol, SocketAddress address, int backlog)
 Creates a socket listening on the specified address. More...
 
int socket_keepalive (int fd)
 

Function Documentation

◆ socket_bind_listen()

int socket_bind_listen ( int  domain,
int  type,
int  protocol,
SocketAddress  address,
int  backlog 
)

Creates a socket listening on the specified address.

This is a shortcut for socket(), bind() and listen().

Throws #std::system_error on error.

Parameters
domainthe socket domain, e.g. PF_INET6
typethe socket type, e.g. SOCK_STREAM
protocolthe protocol, usually 0 to let the kernel choose
addressthe address to listen on
backlogthe backlog parameter for the listen() system call
errorlocation to store the error occurring, or NULL to ignore errors
Returns
the socket file descriptor

◆ socket_keepalive()

int socket_keepalive ( int  fd)