未验证 提交 5a3b0d02 编写于 作者: Z zengyawen 提交者: Gitee

update zh-cn/application-dev/connectivity/websocket-connection.md.

Signed-off-by: Nzengyawen <zengyawen1@huawei.com>
上级 aa800a9e
......@@ -46,7 +46,7 @@ WebSocket连接功能主要由webSocket模块提供。使用该功能需要申
var defaultIpAddress = "ws://";
let ws = webSocket.createWebSocket();
ws.on('open', (err, value) => {
console.log("on open, status:" + value.status + ", message:" + value.message);
console.log("on open, status:" + JSON.stringify(value));
// 当收到on('open')事件时,可以通过send()方法与服务器进行通信
ws.send("Hello, server!", (err, value) => {
if (!err) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册