socket_set_option

(PHP 4 >= 4.3.0, PHP 5)

socket_set_option -- Sets socket options for the socket

Description

bool socket_set_option ( resource socket, int level, int optname, mixed optval )

The socket_set_option() function sets the option specified by the optname parameter, at the specified protocol level, to the value pointed to by the optval parameter for the socket.

Parameters

socket

level

The level parameter specifies the protocol level at which the option resides. For example, to retrieve options at the socket level, a level parameter of 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.

optname

The available socket options are the same as those for the socket_get_option() function.

optval

The option value.

Return Values

Returns TRUE on success or FALSE on failure.

ChangeLog

VersionDescription
4.3.0 This function was renamed. It used to be called socket_setopt().