Linux Socket选项设置
2017-12-01 15:41
531 查看
#include <sys/socket.h> /* 成功返回0,失败返回-1 @sockfd socket的文件描述符 @level 操作的协议层级,具体见下表 @optname 操作选项的名称编号,见下表 @optval 选项的值 @optlen optval的长度 */ int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen); int setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen);
最常用的是操作sockets API level, 此时Level值为: SOL_SOCKET
相关文章推荐
- Linux tcp socket相关参数设置
- 如何设置socket的Connect超时(linux)
- unix/linux socket设置非阻塞io
- [linux] 将socket设置为非阻塞(non-blocking)
- Windows 和 Linux下使用socket下载网页页面内容(可设置接收/发送超时)的代码
- Windows 打印选项设置在 Linux 平台上的一种移植方法
- Linux socket设置mark的必要性
- linux网络编程二十:socket选项:SO_RCVTIMEO和SO_SNDTIMEO
- 关于设置socket选项问题
- Java网络学习笔记2:设置Socket选项
- 如何设置socket的Connect超时(linux)?
- 如何设置socket的Connect超时(linux)---转载
- Linux socket设置mark的必要性
- socket 请求接收完整的一个http响应(设置recv 接收超时选项SO_RCVTIMEO)
- C语言socket编程设置接收超时(Window&Linux)
- linux中设置默认打开vim选项
- 如何设置socket的Connect超时(linux)
- Linux网络编程之套接字选项设置 .
- 如何设置linux socket为非阻塞
- 如何设置socket的Connect超时(linux)