selector_events.py 文件源码

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

项目:golightan 作者: shirou 项目源码 文件源码
def _sock_connect_cb(self, fut, sock, address):
        if fut.cancelled():
            return

        try:
            err = sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
            if err != 0:
                # Jump to any except clause below.
                raise OSError(err, 'Connect call failed %s' % (address,))
        except (BlockingIOError, InterruptedError):
            # socket is still registered, the callback will be retried later
            pass
        except Exception as exc:
            fut.set_exception(exc)
        else:
            fut.set_result(None)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号