IoTCommunicator
IoTCommunicator 对象负责物联网服务器和设备之间与底层网络层(套接字)的所有交互。
| 方法 | 说明 |
|---|---|
| IoTCommunicator(...) | 构造函数:使用可选参数列表创建一个 IoTCommunicator 实例 |
| listen(address, sock_params) | 作为 监听器 通信器工作 |
| stop_listen(address) | 关闭指定 IP 地址上的监听套接字 |
| find_conn(agent_id) | 根据 agentId 返回找到的连接对象 |
| stop() | 停止通信器 |
| destroy() | 销毁底层的通信器对象 |
| 属性 | |
| on_connect | IoTCommunicator 的 on_connect 回调函数(期望为 Python 可调用对象) |
| on_recieve_id | IoTCommunicator 的 on_receive 回调函数(期望为 Python 可调用对象) |
| on_ack | IoTCommunicator 的 on_ack 回调函数(期望为 Python 可调用对象) |
| on_disconnect | IoTCommunicator 的 on_disconnect 回调函数(期望为 Python 可调用对象) |
| connections | 返回此通信器的活动连接列表 |
