def METHOD_NAME(self) -> bool:
    # Adapted from: https://github.com/encode/httpx/pull/143#issuecomment-515202982
    stream = self.stream
    # Peek through any SSLStream wrappers to get the underlying SocketStream.
    while isinstance(stream, trio.SSLStream):
        stream = stream.transport_stream
    assert isinstance(stream, trio.SocketStream)
    return stream.socket.METHOD_NAME()