harmony 鸿蒙net_websocket.h
net_websocket.h
Overview
Defines C APIs for the WebSocket client module.
Library: libnet_websocket.so
System capability: SystemCapability.Communication.NetStack
Since: 11
Related module: Netstack
Summary
Functions
Name | Description |
---|---|
OH_WebSocketClient_Constructor (WebSocket_OnOpenCallback onOpen, WebSocket_OnMessageCallback onMessage, WebSocket_OnErrorCallback onError, WebSocket_OnCloseCallback onclose) | Constructor used to create a WebSocketClient instance. |
OH_WebSocketClient_AddHeader (struct WebSocket *client, struct WebSocket_Header header) | Adds the header information to the client request. |
OH_WebSocketClient_Connect (struct WebSocket *client, const char *url, struct WebSocket_RequestOptions options) | Connects the WebSocket client to the server. |
OH_WebSocketClient_Send (struct WebSocket *client, char *data, size_t length) | Sends data from the WebSocket client to the server. |
OH_WebSocketClient_Close (struct WebSocket *client, struct WebSocket_CloseOption options) | Lets the WebSocket client proactively close the connection. |
OH_WebSocketClient_Destroy (struct WebSocket *client) | Releases the context and resources of the WebSocket connection. |
你可能感兴趣的鸿蒙文章
harmony 鸿蒙NetConn_ConnectionProperties
harmony 鸿蒙NetConn_NetCapabilities
harmony 鸿蒙NetConn_NetConnCallback
harmony 鸿蒙NetConn_NetHandleList
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦