roomgraph.py 文件源码

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

项目:abusehelper 作者: Exploit-install 项目源码 文件源码
def distribute_encode(socks):
    writable = []

    while True:
        to_all, msg = yield idiokit.next()
        msg_bytes = cPickle.dumps(msg, cPickle.HIGHEST_PROTOCOL)
        data = struct.pack("!I", len(msg_bytes)) + msg_bytes

        if to_all:
            for sock in socks:
                yield sock.sendall(data)
            writable = []
        else:
            while not writable:
                _, writable, _ = yield select.select((), socks, ())
                writable = list(writable)
            yield writable.pop().sendall(data)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号