Module posish::net [−][src]
Expand description
Network-related operations.
Structs
SOCK_*
constants for accept
.
AF_*
constants.
struct in_addr
struct in6_addr
MSG_*
MSG_*
struct sockaddr_un
struct sockaddr_in
struct sockaddr_in6
SOCK_*
constants for socket
.
Enums
Functions
accept(fd, NULL, NULL)
—Accepts an incoming connection.
accept4(fd, NULL, NULL, flags)
—Accepts an incoming connection, with
flags.
accept(fd, &addr, &len)
—Accepts an incoming connection and returns the
peer address.
`accept4(fd, &addr, &len, flags)—Accepts an incoming connection and returns the peer address, with flags.
bind(sockfd, addr, sizeof(struct sockaddr_un))
—Binds a socket to an
address.
bind(sockfd, addr, sizeof(struct sockaddr_in))
—Binds a socket to an
address.
bind(sockfd, addr, sizeof(struct sockaddr_in6))
—Binds a socket to an
address.
connect(sockfd, addr, sizeof(struct sockaddr_un))
—Initiates a
connection.
connect(sockfd, addr, sizeof(struct sockaddr_in))
—Initiates a
connection.
connect(sockfd, addr, sizeof(struct sockaddr_in6))
—Initiates a
connection.
getpeername(fd, addr, len)
—Returns the address a socket is connected
to.
getsockname(fd, addr, len)
—Returns the address a socket is bound to.
getsockopt(fd, SOL_SOCKET, SO_TYPE)
—Returns the type of a socket.
listen(fd, backlog)
—Enables listening for incoming connections.
recv(fd, buf, flags)
—Reads data from a socket.
recvfrom(fd, buf, flags, addr, len)
—Reads data from a socket and
returns the sender address.
send(fd, buf, flags)
—Writes data to a socket.
sendto(fd, buf, flags, addr, sizeof(struct sockaddr_un))
—Writes data to
a socket to a specific Unix-domain socket address.
sendto(fd, buf, flags, addr, sizeof(struct sockaddr_in))
—Writes data to
a socket to a specific IPv4 address.
sendto(fd, buf, flags, addr, sizeof(struct sockaddr_in6))
—Writes data
to a socket to a specific IPv6 address.
shutdown(fd, how)
—Closes the read and/or write sides of a stream.
socket(domain, type_, protocol)
—Creates a socket.
socketpair(domain, type_ | accept_flags, protocol)