protected function getStream($socket)
    {
        if (class_exists(DuplexResourceStream::class)) {
            return new DuplexResourceStream($socket, $this->getLoop());
        }

        return new Stream($socket, $this->getLoop());
    }