/** * Sets the receive timeout. * Returns true on success, or false. * @param int $timeout Timeout in milliseconds. * @return boolean */ public function setRecvTimeout($timeout) { if (!$this->isOpen()) { self::$defaultRecvTimeout = $timeout; } else { $r = socket_set_option($this->socket, SOL_SOCKET, SO_RCVTIMEO, $this->millisecToSolArray($timeout)); return $r; } }