public function write($message)
    {
        if ($this->isError() || ! $this->isOpen()) {
            return false;
        }
        $count = fwrite($this->handle, $message);
        if (! $count) {
            if ($count === false) {
                $this->setError('Cannot write to socket');
                $this->close();
            }

            return false;
        }
        fflush($this->handle);
        $this->sent .= $message;

        return true;
    }