harmony 鸿蒙NetConn_NetConnCallback
NetConn_NetConnCallback
Overview
Defines network status callbacks.
Since: 12
Related module: NetConnection
Header file: net_connection_type.h
Summary
Member Variables
Name | Description |
---|---|
onNetworkAvailable | Called when the network is available. |
onNetCapabilitiesChange | Called when the network capabilities change. |
onConnetionProperties | Called when network connection properties change. |
onNetLost | Called when the network is disconnected. |
onNetUnavailable | Called when the network is unavailable. This callback is triggered when the network is not activated within the specified timeout interval. If the timeout interval is not set, this callback is not triggered. |
Member Variable Description
onNetworkAvailable
typedef void (*OH_NetConn_NetworkAvailable)(NetConn_NetHandle *netHandle)
Description
Called when the network is available.
Description
After the callback is complete, the parameter memory is automatically cleared and therefore the parameter pointer should be released.
Parameters
Name | Type | Description |
---|---|---|
netHandle | NetHandle | Network handle. |
onNetCapabilitiesChange
typedef void (*OH_NetConn_NetCapabilitiesChange)(NetConn_NetHandle *netHandle, NetConn_NetCapabilities *netCapabilities)
Description
Called when the network capabilities change.
Description
After the callback is complete, the parameter memory is automatically cleared and therefore the parameter pointer should be released.
Parameters
Name | Type | Description |
---|---|---|
netHandle | NetHandle | Network handle. |
netCapabilities | NetCapabilities | Network capabilities. |
onConnetionProperties
typedef void (*OH_NetConn_NetConnectionPropertiesChange)(NetConn_NetHandle *netHandle, NetConn_ConnectionProperties *connConnetionProperties)
Description
Called when network connection properties change.
Description
After the callback is complete, the parameter memory is automatically cleared and therefore the parameter pointer should be released.
Parameters
Name | Type | Description |
---|---|---|
netHandle | NetHandle | Network handle. |
connConnetionProperties | ConnectionProperties | Network connection properties. |
onNetLost
typedef void (*OH_NetConn_NetLost)(NetConn_NetHandle *netHandle)
Description
Called when the network is disconnected.
Description
After the callback is complete, the parameter memory is automatically cleared and therefore the parameter pointer should be released.
Parameters
Name | Type | Description |
---|---|---|
netHandle | NetHandle | Network handle. |
onNetUnavailable
typedef void (*OH_NetConn_NetUnavailable)(void)
Description
Called when the network is unavailable. This callback is triggered when the network is not activated within the specified timeout interval. If the timeout interval is not set, this callback is not triggered.
你可能感兴趣的鸿蒙文章
harmony 鸿蒙NetConn_ConnectionProperties
harmony 鸿蒙NetConn_NetCapabilities
harmony 鸿蒙NetConn_NetHandleList
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦