Class: WebSocketClient experimental
networkBeta
一个活跃的 WebSocket 客户端。
An active WebSocket client.
Properties
afterEvents
readonlyafterEvents:WebSocketClientAfterEvents
Beta
Remarks
包含与此 WebSocket 客户端相关的一组事件。
Contains a set of events related to this WebSocket client.
isOpen
readonlyisOpen:boolean
Beta
Remarks
如果当前已连接到服务器,则为 true。
Set to true if the socket is current connected to the server.
Methods
close()
close():
void
World Mutation Beta
Returns
void
Remarks
关闭与服务器的连接。
Closes the connection with the server.
Throws
This function can throw errors.
send()
send(
payload):void
World Mutation Beta
Parameters
payload
string
将被包含在网络数据包中的有效负载。 The payload that will be included in the network packet.
Returns
void
Remarks
将提供的有效负载发送到服务器。
Sends the provided payload to the server.
Throws
This function can throw errors.
