resolver.py 文件源码

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

项目:ZServer 作者: zopefoundation 项目源码 文件源码
def handle_read(self):
        reply, whence = self.socket.recvfrom(512)
        # for security reasons we may want to double-check
        # that <whence> is the server we sent the request to.
        id = (ord(reply[0]) << 8) + ord(reply[1])
        if id in self.request_map:
            host, unpack, callback, when = self.request_map[id]
            del self.request_map[id]
            ttl, answer = unpack(reply)
            try:
                callback(host, ttl, answer)
            except Exception:
                (file, fun, line), t, v, tbinfo = asyncore.compact_traceback()
                self.log_info('%s %s %s' % (t, v, tbinfo), 'error')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号