Perl 中的 setsockopt函数

首页 / Perl入门教程 / Perl 中的 setsockopt函数

描述

此函数将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).

祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)

技术教程推荐

硅谷产品实战36讲 -〔曲晓音〕

消息队列高手课 -〔李玥〕

OAuth 2.0实战课 -〔王新栋〕

用户体验设计实战课 -〔相辉〕

反爬虫兵法演绎20讲 -〔DS Hunter〕

说透低代码 -〔陈旭〕

云计算的必修小课 -〔吕蕴偲〕

大型Android系统重构实战 -〔黄俊彬〕

结构执行力 -〔李忠秋〕

好记忆不如烂笔头。留下您的足迹吧 :)