tencent cloud

Tencent Cloud Observability Platform

Socket Overview

PDF
フォーカスモード
フォントサイズ
最終更新日: 2025-03-11 20:32:31
After successfully establishing a WebSocket connection, PTS passes the created ws.Socket object into the callback function, allowing users to define the WebSocket request logic by calling the methods of the Socket.

Methodology

Methodology
Return Type
Description
close()
void
Close connection.
void
Listen for message events and process events according to the callback; the list of events currently supported by PTS is as follows:
Open: Establish the connection.
Close: Close the connection.
Message: Receive text messages.
binaryMessage: Receive binary messages.
pong: Receive pong messages.
ping: Receive ping messages.
ping()
void
Send ping messages.
send(msg)
void
Send text messages.
void
Send binary messages.
void
Set the polling function.
void
Set the loop executed function.
void
Set the timeout function.


ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック