public function isTimedOut()
    {
        if (is_resource($this->socket)) {
            $info = stream_get_meta_data($this->socket);
        }

        return $this->socket === null || $this->socket === false || $info['timed_out'] || feof($this->socket);
    }