Closes the connection, sending a graceful teardown message to the other side.
Is there a message in the buffer already? If true, waitForNextMessage is guaranteed to return immediately. If false, check isDataPending as the next step.
Group: browser_api
Sends a ping message to the server. This is done automatically by the library if you set a non-zero Config.pingFrequency, but you can also send extra pings explicitly as well with this function.
Returns one of CONNECTING, OPEN, CLOSING, or CLOSED.
Sends a text message through the websocket.
Sends a binary message through the websocket.
Waits for and returns the next complete message on the socket.
Tells if waitForNextMessage would block.
The connection is closed or couldn't be opened.
The connection is in the process of closing.
Socket has been created. The connection is not yet open.
The connection is open and ready to communicate.
Group: foundational
WEBSOCKET SUPPORT:
Full example: