tencent cloud

All product documents
Tencent Cloud Observability Platform
Socket Overview
Last updated: 2025-03-11 20:32:31
Socket Overview
Last updated: 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.

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon