« EventUtil::getSocketName
EventUtil::sslRandPoll »

EventUtil::setSocketOption

(PECL event >= 1.6.0)

EventUtil::setSocketOption — Sets socket options

説明

public static function EventUtil::setSocketOption(
     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, a level parameter of EventUtil::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.

戻り値

成功した場合に true を、失敗した場合に false を返します。

参考

関連キーワード:
socket   EventUtil   level   options   option   Sets   setSocketOption   optval   constants   parameter   mixed   optname   protocol   used   ソケット   getSocketName   sslRandPoll   event   static   Socket   resource   stream   numeric   descriptor   associated
関連する関数・ページ:
eventutil.getsocketfd   class.eventutil   eventutil.getlastsocketerror   eventutil.getlastsocketerrno   eventutil.getsocketname   eventutil.construct