socket_cmsg_space
Calculate the message buffer size
Function name: socket_cmsg_space()
Function description: socket_cmsg_space() function is used to calculate the buffer size of the specified control information type and length.
Applicable version: PHP 5 >= 5.5.0, PHP 7
Syntax: socket_cmsg_space(int $level, int $type) : int
parameter:
Return value: Returns the buffer size of the specified control information type and length.
Example:
$level = SOL_SOCKET; $type = SCM_RIGHTS; $bufferSize = socket_cmsg_space($level, $type); echo "缓冲区大小为:$bufferSize 字节";
Output:
缓冲区大小为:20 字节
Notes: