tox.py 文件源码

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

项目:milisia-tox 作者: milisarge 项目源码 文件源码
def callback_self_connection_status(self, callback, user_data):
        """
        Set the callback for the `self_connection_status` event. Pass None to unset.

        This event is triggered whenever there is a change in the DHT connection state. When disconnected, a client may
        choose to call tox_bootstrap again, to reconnect to the DHT. Note that this state may frequently change for
        short amounts of time. Clients should therefore not immediately bootstrap on receiving a disconnect.

        :param callback: Python function. Should take pointer (c_void_p) to Tox object,
        TOX_CONNECTION (c_int),
        pointer (c_void_p) to user_data
        :param user_data: pointer (c_void_p) to user data
        """
        c_callback = CFUNCTYPE(None, c_void_p, c_int, c_void_p)
        self.self_connection_status_cb = c_callback(callback)
        Tox.libtoxcore.tox_callback_self_connection_status(self._tox_pointer,
                                                           self.self_connection_status_cb, user_data)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号