Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

socket_cmsg_space

Description

The socket_cmsg_space of Sockets for PHP calculate message buffer size.

Syntax

socket_cmsg_space(
    int $level,
    int $type,
    int $num = 0
): ?int

Parameters

level

The originating protocol.

type

The protocol-specific type.

num

The number of bytes.

Return

Returns the buffer size.

Examples

1 · level type

<?

$level = SOL_SOCKET;
$type = SCM_CREDENTIALS;

$return = socket_cmsg_space($level, $type);

echo $return;

?>
32

2 · num

<?

$level = SOL_SOCKET;
$type = SCM_RIGHTS;
$num = 3;

$return = socket_cmsg_space($level, $type, $num);

echo $return;

?>
32
HomeMenu