private function onWritable()
    {
        $bytesWritten = @\fwrite($this->socket, $this->writeBuffer);

        if ($bytesWritten === false) {
            $this->close();
            return;
        }

        if ($bytesWritten === 0) {
            return;
        }

        $this->timeoutCache->renew($this->id);

        if ($bytesWritten !== \strlen($this->writeBuffer)) {
            $this->writeBuffer = \substr($this->writeBuffer, $bytesWritten);
            return;
        }

        $this->writeBuffer = "";

        Loop::disable($this->writeWatcher);
        $deferred = $this->writeDeferred;
        $this->writeDeferred = null;
        $deferred->resolve();
    }
private function onWritable()
    {
        $bytesWritten = @\fwrite($this->socket, $this->writeBuffer);

        if ($bytesWritten === false) {
            $this->close();
            return;
        }

        if ($bytesWritten === 0) {
            return;
        }

        $this->timeoutCache->renew($this->id);

        if ($bytesWritten !== \strlen($this->writeBuffer)) {
            $this->writeBuffer = \substr($this->writeBuffer, $bytesWritten);
            return;
        }

        $this->writeBuffer = "";

        Loop::disable($this->writeWatcher);
        $deferred = $this->writeDeferred;
        $this->writeDeferred = null;
        $deferred->resolve();
    }
private function onWritable ( ) { $ bytesWritten = @ \ fwrite ( $ this -> socket , $ this -> writeBuffer ) ; if ( $ bytesWritten === false ) { $ this -> close ( ) ; return ; } if ( $ bytesWritten === 0 ) { return ; } $ this -> timeoutCache -> renew ( $ this -> id ) ; if ( $ bytesWritten !== \ strlen ( $ this -> writeBuffer ) ) { $ this -> writeBuffer = \ substr ( $ this -> writeBuffer , $ bytesWritten ) ; return ; } $ this -> writeBuffer = "" ; Loop :: disable ( $ this -> writeWatcher ) ; $ deferred = $ this -> writeDeferred ; $ this -> writeDeferred = null ; $ deferred -> resolve ( ) ; }
Called by the onWritable watcher.
Called by the onWritable watcher .