EventUtil::setSocketOption
(PECL event >= 1.6.0)
EventUtil::setSocketOption — Sets socket options
说明
mixed
$socket
,int
$level
,int
$optname
,mixed
$optval
): bool
Sets socket options.
参数
-
socket
-
Socket resource, stream, or numeric file descriptor associated with the socket.
-
level
-
One of
EventUtil::SOL_*
constants. Specifies the protocol level at which the option resides. For example, to retrieve options at the socket level, alevel
parameter ofEventUtil::SOL_SOCKET
would be used. Other levels, such as TCP, can be used by specifying the protocol number of that level. Protocol numbers can be found by using the getprotobyname() function. See EventUtil constants . -
optname
-
Option name(type). Has the same meaning as corresponding parameter of socket_get_option() function. See EventUtil constants .
-
optval
-
Accepts the same values as
optval
parameter of the socket_get_option() function.
参见
- socket_get_option() - 获取套接字的套接字选项
- socket_set_option() - 为套接字设置套接字选项
用户贡献的备注
备份地址:http://www.lvesu.com/blog/php/eventutil.setsocketoption.php