Python 官方文档:入门教程 => 点击学习
默认的Socket选项不够用的时候,就必须要使用setsockopt来调整。就是使用setsockopt。 首先看一下socket的setsockopt 函数的定义: socket.setsockopt(level,optname,
默认的Socket选项不够用的时候,就必须要使用setsockopt来调整。就是使用setsockopt。
首先看一下socket的setsockopt 函数的定义:
Set the value of the given socket option (see the Unix manual pagesetsockopt(2)). The needed symbolic constants are defined in thesocket module (SO_* etc.). The value can be an integer or a string representing a buffer. In the latter case it is up to the caller to ensure that the string contains the proper bits (see the optional built-in modulestruct for a way to encode C structures as strings).
level:选项定义的层次。支持SOL_SOCKET、IPPROTO_tcp、IPPROTO_IP和IPPROTO_IPV6。
optname:需设置的选项。
value:设置选项的值。
--结束END--
本文标题: python使用setsockopt
本文链接: https://www.lsjlt.com/news/191632.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0