These functions create unbound sockets. This is usually not necessary, since connectors and listeners create their own.
Creates a unix socket for the unix address family, of type :stream and (on success) returns its file descriptor.
Creates a unix socket for the internet address family, of type :stream and (on success) returns its file descriptor.
Once a socket is created, it is sometimes useful to bind the socket to a
local address using
Bind the socket to a local interface address specified by host and port.
Further, it is desirable to be able to change socket options. This is performed by the following two functions, which are essentially wrappers for system calls to getsockopt and setsockopt.
Gets the value of option optname from the socket socket.
Sets the value of option optname from the socket socket to the value optval.
For information on possible options and values we refer to the manpages of getsockopt and setsockopt, and to socket.h.
Finally, the function
Closes the socket given by the file descriptor socket.