private function free()
    {
        $this->resource = null;
        $this->writable = false;

        if (!$this->writes->isEmpty()) {
            $exception = new ClosedException("The socket was closed before writing completed");
            do {
                /** @var \Amp\Deferred $deferred */
                list(, , $deferred) = $this->writes->shift();
                $deferred->fail($exception);
            } while (!$this->writes->isEmpty());
        }

        Loop::cancel($this->watcher);
    }
private function free()
    {
        $this->resource = null;
        $this->writable = false;

        if (!$this->writes->isEmpty()) {
            $exception = new ClosedException("The socket was closed before writing completed");
            do {
                /** @var \Amp\Deferred $deferred */
                list(, , $deferred) = $this->writes->shift();
                $deferred->fail($exception);
            } while (!$this->writes->isEmpty());
        }

        Loop::cancel($this->watcher);
    }
private function free ( ) { $ this -> resource = null ; $ this -> writable = false ; if ( ! $ this -> writes -> isEmpty ( ) ) { $ exception = new ClosedException ( "The socket was closed before writing completed" ) ; do { /** @var \Amp\Deferred $deferred */ list ( , , $ deferred ) = $ this -> writes -> shift ( ) ; $ deferred -> fail ( $ exception ) ; } while ( ! $ this -> writes -> isEmpty ( ) ) ; } Loop :: cancel ( $ this -> watcher ) ; }
Nulls reference to resource, marks stream unwritable, and fails any pending write.
Nulls reference to resource marks stream unwritable and fails any pending write .