transport.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:wetland 作者: ohmyadd 项目源码 文件源码
def getpeername(self):
        """
        Return the address of the remote side of this Transport, if possible.

        This is effectively a wrapper around ``getpeername`` on the underlying
        socket.  If the socket-like object has no ``getpeername`` method, then
        ``("unknown", 0)`` is returned.

        :return:
            the address of the remote host, if known, as a ``(str, int)``
            tuple.
        """
        gp = getattr(self.sock, 'getpeername', None)
        if gp is None:
            return 'unknown', 0
        return gp()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号