socket_recv

Синтаксис

native socket_recv(_socket, _data[], _length);

Употреба

_socket
Socket descriptor
_data
Array to save the data
_length
Length of the array

Описание

Receives data.

Забележка

The amount of bytes than you end up receiving can be less than the one you expected.

Забележка

This function will completely block the server until some data arrives
to the given socket. Use this only if you are sure there is some data
to be retrieved. You can do that by polling with socket_is_readable().

Връщаща стойност

Amount of bytes received
0 if the peer closed the connection
-1 on failure