资料来源: 微软MSDN在线帮助

setsockopt(s, level, optname, optval, optlen) 函数
https://msdn.microsoft.com/library/windows/desktop/ms740476.aspx

level = SOL_SOCKET

optname编码 Type Description
SO_BROADCAST BOOL Configures a socket for sending broadcast data.
SO_CONDITIONAL_ACCEPT BOOL Enables incoming connections are to be accepted or rejected by the application, not by the protocol stack.
SO_DEBUG BOOL Enables debug output. Microsoft providers currently do not output any debug information.
SO_DONTLINGER BOOL Does not block close waiting for unsent data to be sent. Setting this option is equivalent to setting SO_LINGER with l_onoff set to zero.
SO_DONTROUTE BOOL Sets whether outgoing data should be sent on interface the socket is bound to and not a routed on some other interface. This option is not supported on ATM sockets (results in an error).
SO_GROUP_PRIORITY int Reserved.
SO_KEEPALIVE BOOL Enables sending keep-alive packets for a socket connection. Not supported on ATM sockets (results in an error).
SO_LINGER LINGER Lingers on close if unsent data is present.
SO_OOBINLINE BOOL Indicates that out-of-bound data should be returned in-line with regular data. This option is only valid for connection-oriented protocols that support out-of-band data. For a discussion of this topic, see Protocol Independent Out-Of-band Data.
SO_RCVBUF int Specifies the total per-socket buffer space reserved for receives.
SO_REUSEADDR BOOL Allows the socket to be bound to an address that is already in use. For more information, see bind. Not applicable on ATM sockets.
SO_EXCLUSIVEADDRUSE BOOL Enables a socket to be bound for exclusive access. Does not require administrative privilege.
SO_RCVTIMEO DWORD Sets the timeout, in milliseconds, for blocking receive calls.
SO_SNDBUF int Specifies the total per-socket buffer space reserved for sends.
SO_SNDTIMEO DWORD The timeout, in milliseconds, for blocking send calls.
SO_UPDATE_ACCEPT_CONTEXT int Updates the accepting socket with the context of the listening socket.
PVD_CONFIG Service Provider Dependent This object stores the configuration information for the service provider associated with socket s. The exact format of this data structure is service provider specific.

详细参数

socket 函数 setsockopt()用法相关推荐

  1. socket()函数用法详解:创建套接字

    不管是 Windows 还是 Linux,都使用 socket() 函数来创建套接字.socket() 在两个平台下的参数是相同的,不同的是返回值. 在<socket是什么>一节中我们讲到 ...

  2. python socket.socket()函数 套接字详解及TCP、UDP程序示例(粘包等)

    文章目录 socket的定义 套接字的工作流程 socket函数使用 socket函数用法 服务端套接字函数 客户端套接字函数 公共用途的套接字函数 面向文件的套接字方法 打电话的流程演示 服务端.p ...

  3. Python批量检测服务器端口可用性与Socket函数使用

    socket函数 简述 socket又称套间字或者插口,是网络通信中必不可少的工具.有道是:"无socket,不网络".由于socket最早在BSD Unix上使用,而Unix/L ...

  4. C语言socket()函数解析(创建套接字)af地址族,ip地址类型(Address Family)INET(Inetnet)PF(Protocol Family)

    文章目录 Linux 下的 socket() 函数 1) af 为地址族(Address Family),也就是 IP 地址类型 2) type 为数据传输方式/套接字类型 3) protocol 表 ...

  5. sprintf函数的用法_我在C++项目中对于宏的一些用法

    从上一次写文章到现在已经快2个月了,为啥没更新,因为太忙了! 每天都在为了实现一些麻烦的功能而心急火燎,总是没办法静下心来写文章.所以一直拖延. 对于宏的一些个人用法其实早就想写出来了,碍于时间关系一 ...

  6. Linux Socket函数手册(二)

    1) int accept(int s,struct sockaddr * addr,int * addrlen); 函数说明 accept()用来接受参数s的socket连线.参数s的socket必 ...

  7. lseek函数的用法

    lseek函数的用法 所有打开的文件都有一个当前文件偏移量(current file offset),以下简称为 cfo.cfo 通常是一个非负整数,用于表明文件开始处到文件当前位置的字节数.读写操作 ...

  8. Socket函数说明

    第六章  Socket函数说明 6.1  库函数综述 6.1.1  套接字函数 表6.1  Windows Sockets 1.1版本的Berkeley Sockets函数 accept() 确认外来 ...

  9. python中socket详解_python socket函数详解

    关于socket函数,每个的意义和基本功能都知道,但每次使用都会去百度,参数到底是什么,返回值代表什么意义,就是说用的少,也记得不够精确.每次都查半天,经常烦恼于此.索性都弄得清楚.通透,并记录下来, ...

最新文章

  1. concurrenthashmap在1.8和1.7里面有什么区别
  2. 【POJ 3273】 Monthly Expense (二分)
  3. 【若依(ruoyi)】按钮怎么挨到一起了?
  4. 《磨难之间》——刻意设计,缺失核心
  5. 学习设计模式 - 六大基本原则之接口隔离原则
  6. 圆方圆学院零基础入门学习Python(绝对干货,值得学习)
  7. mac下安装brew下载非常慢解决方法
  8. java告警系统设计_告警系统的设计
  9. javascript 理解对象--- 定义多个属性和读取属性的特性
  10. 【项目管理】------九大项目管理框架 (
  11. c51语言的注释,单片机C51编程规范
  12. 大一计算机理论知识测试题,2017计算机基础大一考试试题「附答案」
  13. pr如何跳到关键帧_PR剪辑小问题汇总—新老司机都会遇到的!
  14. B站上优质python教程推荐
  15. 《我与长安城的朝花夕拾》
  16. 在线CAD平台,MxCAD云图 2021.01.20更新,在线CAD软件
  17. csgo显示未加入国服服务器,csgo国服新手常见问题汇总介绍
  18. android 仿微信demo————微信主界面实现
  19. phpcms富文本框上传图片去除水印
  20. 时间与日期处理模块 题目解题报告

热门文章

  1. android如何用代码实现界面ui
  2. 用户登入身份验证,手机app登入身份验证,TokenAuth身份验证,JSON Web Token(JWT)身份验证
  3. java8堆内存模型_「GC系列」JVM堆内存分代模型及常见的垃圾回收器
  4. 普通话测试第四题评分标准_2017年普通话考试-评分细则
  5. python 微服务 etcd_python etcd api
  6. 电脑格式化的危害_经常重装系统,对电脑会不会有负面影响?
  7. PCL之多可视化窗口
  8. 爬取猫眼电影相关信息
  9. mysql sample函数_SAMPLE函数
  10. Linux命令解释之head