This section will cover best practices for WebSockets based applications. The following topics will be covered:
After the WebSocket connection is opened, messages can be sent using the send function.
WebSockets have a
bufferedAmount attribute that can be used to control the rate of sending data. Using the
bufferedAmount attribute you can check the number of bytes that have been queued but not yet sent to the server.
Here is a snippet to test for the
bufferedAmount attribute of WebSocket.
// This snippet checks for amount of data buffered but not sent ...