It is perfectly valid for socket_write to return zero which means no bytes have been written.
Be sure to use the === operator to check for FALSE in case of an error.
public send ( |
||
$client | Connected client to write to | |
$message | string | Data to write to the socket. |
$end | string | Data to end the line with. Specify false if you don't want a line end sent. |
return | mixed | Returns the number of bytes successfully written to the socket or FALSE on failure. The error code can be retrieved with socket_last_error(). This code may be passed to socket_strerror() to get a textual explanation of the error. |