45#define SOCK_STREAM (1)
60#define PF_INET AF_INET
61#define PF_INET6 AF_INET6
67#define SO_REUSEADDR (2)
70#define SO_RCVTIMEO (3)
73#define SO_SNDTIMEO (4)
79#define SO_KEEPALIVETIME (1001)
103int socket(
int domain,
int type,
int protocol);
164ssize_t
recv(
int socket,
void *buffer,
size_t length,
int flags);
174ssize_t
send(
int socket,
const void *buffer,
size_t length,
int flags);
187 const void *option_value,
socklen_t option_len);
200 void *option_value,
socklen_t *option_len);
ssize_t recv(int socket, void *buffer, size_t length, int flags)
Receive a message from a connection-mode or connectionless-mode socket.
int accept(int socket, struct sockaddr *address, socklen_t *address_len)
Accept a new connection on a socket.
uint32_t socklen_t
type of sockaddr lenth
int setsockopt(int socket, int level, int option_name, const void *option_value, socklen_t option_len)
Set the socket options.
int bind(int socket, const struct sockaddr *address, socklen_t address_len)
Bind a name to a socket.
ssize_t send(int socket, const void *buffer, size_t length, int flags)
Initiate transmission of a message from the specified socket.
int getsockopt(int socket, int level, int option_name, void *option_value, socklen_t *option_len)
Get the socket options.
int listen(int socket, int backlog)
Mark a connection-mode socket, specified by the socket argument, as accepting connections.
int connect(int socket, const struct sockaddr *address, socklen_t address_len)
Connect a socket.
int socket(int domain, int type, int protocol)
Create an unbound socket in a communications domain.
uint16_t sa_family
address family (e.g.
uint8_t sa_data[14]
protocol specific address information