mco_iot_conn_get_address
此函数通过连接句柄返回连接地址(用于连接套接字)。
const char * mco_iot_conn_get_address(
iot_connection_h iotc
);有关概述,请参阅主动复制结构页面。
参数
iotc
iot_connection_h
连接句柄。
返回
const char *
如果连接是通过 mco_iot_comm_connect_async() 或 mco_iot_replicator_connect() 创建的,则为字符串连接地址参数;否则为 NULL。
示例
{
...
// Print the peer address for agent_id:
mco_iot_connection_h conn = mco_iot_comm_find_conn(comm, agent_id);
printf("Address : %s\n", mco_iot_conn_get_address(conn));
mco_iot_conn_release(conn);
...
}文件
- 头文件:
mcoiot.h - 源文件:
mcoiotcomm.c - 库:
libmcoiotcomm.a
