src/ResourceSocket.php
function close() {
        if($this->closed || (!$this->writable && !$this->closing)) {
            return;
        }
        
        $this->closing = false;
        $this->readable = false;
        $this->writable = false;
        
        $this->pause();
        $this->emit('close');
        
        $this->closed = true;
        $this->data = '';
        
        $this->removeAllListeners();
        
        if(\is_resource($this->socket)) {
            @\socket_shutdown($this->socket, 2);
            
            if(static::$closeResource) {
                \socket_close($this->socket);
            }
        }
    }
function close() {
        if($this->closed || (!$this->writable && !$this->closing)) {
            return;
        }
        
        $this->closing = false;
        $this->readable = false;
        $this->writable = false;
        
        $this->pause();
        $this->emit('close');
        
        $this->closed = true;
        $this->data = '';
        
        $this->removeAllListeners();
        
        if(\is_resource($this->socket)) {
            @\socket_shutdown($this->socket, 2);
            
            if(static::$closeResource) {
                \socket_close($this->socket);
            }
        }
    }
Closes the stream (forcefully).
@return void
@see \React\Stream\ReadableStreamInterface::close()