此函数将SocketoptionsOPTNAME的值设置为SOCKET上指定级别的OPTVAL值。您需要导入Socket模块,以获取Tabl中显示的OPTNAME的有效值
以下是此函数的简单语法-
链接:https://www.learnfk.comhttps://www.learnfk.com/perl/perl-setsockopt.html
来源:LearnFk无涯教程网
setsockopt SOCKET, LEVEL, OPTNAME, OPTVAL
如果失败,此函数返回undef;如果成功,则返回1。
OPTNAME 描述 SO_DEBUG Enable/disable recording of debugging information. SO_REUSEADDR Enable/disable local address reuse. SO_KEEPALIVE Enable/disable keep connections alive. SO_DONTROUTE Enable/disable routing bypass for outgoing messages. SO_LINGER Linger on close if data is present. SO_BROADCAST Enable/disable permission to transmit broadcast messages. SO_OOBINLINE Enable/disable reception of out-of-band data in band. SO_SNDBUF Set buffer size for output. SO_RCVBUF Set buffer size for input. SO_TYPE Get the type of the socket (get only). SO_ERROR Get and clear error on the socket (get only).
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)