Returns information about an existing socket resource.
Currently returns four entries in the result array:
timed_out (bool) - The socket timed out waiting for data blocked (bool) - The socket was blocked eof (bool) - Indicates EOF event unread_bytes (int) - Number of bytes left in the socket buffer </p>
Return: Array containing information about existing socket resource or a PEAR_Error instance otherwise
Read a specified amount of data. This is guaranteed to return, and has the added benefit of getting everything in one fread() chunk; if you know the size of the data you're getting beforehand, this is definitely the way to go.
Return: bytes of data from the socket, or a PEAR_Error if not connected.
Read until the socket closes, or until there is no more data in
the inner PHP buffer. If the inner buffer is empty, in blocking mode we wait for at least 1 byte of data. Therefore, in blocking mode, if there is no data at all to be read, this function will never exit (unless the socket is closed on the remote end).
Return: All data until the socket closes, or a PEAR_Error if not connected.
Sets whether the socket connection should be blocking or not. A read call to a non-blocking socket will return immediately if there is no data available, whereas it will block until there is data for blocking sockets.
Return: true on success or a PEAR_Error instance otherwise
Return: If the socket is not connected, returns an instance of PEAR_Error. If the write succeeds, returns the number of bytes written. If the write fails, returns false. If the socket times out, returns an instance of PEAR_Error.
Data to write.
Amount of data to write at once. NULL means all at once.