protocol.py 文件源码

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

项目:SameKeyProxy 作者: xzhou 项目源码 文件源码
def sock_recvmsg(sock, size, timeout=0):
    while True:
        try:
            return _recv_msg(sock,size,timeout)
        except socket.timeout:
            raise TimeoutError("connection timeout receiving")
        except socket.error,x:
            if x.args[0] == errno.EINTR or (hasattr(errno, 'WSAEINTR') and x.args[0] == errno.WSAEINTR):
                # interrupted system call, just retry
                continue
            raise ConnectionClosedError('connection lost: %s' % x)
        except SSLError,x:
            raise ConnectionClosedError('connection lost: %s' % x)

# select the optimal recv() implementation
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号