public function disconnect()
    {
        $streamResource = $this->getStreamResource();

        if (is_resource($streamResource)) {
            stream_socket_shutdown($streamResource, STREAM_SHUT_RDWR);
            $this->streamResource = null;
        }

        return $this;
    }