13 #define SOL_SOCKET 0xFFFF
19 #define AF_UNSPEC PF_UNSPEC
20 #define AF_INET PF_INET
21 #define AF_INET6 PF_INET6
26 #define MSG_OOB 0x0001
27 #define MSG_PEEK 0x0002
28 #define MSG_DONTWAIT 0x0004
29 #define MSG_DONTROUTE 0x0000 // ???
30 #define MSG_WAITALL 0x0000 // ???
31 #define MSG_MORE 0x0000 // ???
32 #define MSG_NOSIGNAL 0x0000 // there are no signals
41 #define SO_REUSEADDR 0x0004 // reuse address
42 #define SO_LINGER 0x0080 // linger (no effect?)
43 #define SO_OOBINLINE 0x0100 // out-of-band data inline (no effect?)
44 #define SO_SNDBUF 0x1001 // send buffer size
45 #define SO_RCVBUF 0x1002 // receive buffer size
46 #define SO_SNDLOWAT 0x1003 // send low-water mark (no effect?)
47 #define SO_RCVLOWAT 0x1004 // receive low-water mark
48 #define SO_TYPE 0x1008 // get socket type
49 #define SO_ERROR 0x1009 // get socket error
167 struct timeval *timeout);
int listen(int sockfd, int backlog)
ssize_t recv(int sockfd, void *buf, size_t len, int flags)
int getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen)
int socket(int domain, int type, int protocol)
int setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen)
int getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
ssize_t send(int sockfd, const void *buf, size_t len, int flags)
ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen)
int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen)
ssize_t recvfrom(int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen)
int closesocket(int sockfd)
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen)
int shutdown(int sockfd, int how)