APUE:网络IPC:套接字
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了APUE:网络IPC:套接字相关的知识,希望对你有一定的参考价值。
#define AF_UNSPEC PF_UNSPEC #define AF_LOCAL PF_LOCAL #define AF_UNIX PF_UNIX #define AF_INET PF_INET #define AF_INET6 PF_INET6 enum __socket_type { SOCK_STREAM = 1, /* Sequenced, reliable, connection-based byte streams. */ SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams of fixed maximum length. */ SOCK_RAW = 3, /* Raw protocol interface. */ }; int socket (int __domain, int __type, int __protocol); int shutdown (int __fd, int __how); int close (int __fd); int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len); int listen (int __fd, int __n); int accept (int __fd, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len); int connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len); int getsockname (int __fd, __SOCKADDR_ARG __addr, socklen_t *__restrict __len); int getpeername (int __fd, __SOCKADDR_ARG __addr, socklen_t *__restrict __len); ssize_t send (int __fd, const void *__buf, size_t __n, int __flags); ssize_t sendto (int __fd, const void *__buf, size_t __n, int __flags, __CONST_SOCKADDR_ARG __addr, socklen_t __addr_len); ssize_t sendmsg (int __fd, const struct msghdr *__message, int __flags); ssize_t recv (int __fd, void *__buf, size_t __n, int __flags); ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len); ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags); int getsockopt (int __fd, int __level, int __optname, void *__restrict __optval, socklen_t *__restrict __optlen); int setsockopt (int __fd, int __level, int __optname, const void *__optval, socklen_t __optlen);
以上是关于APUE:网络IPC:套接字的主要内容,如果未能解决你的问题,请参考以下文章