send package:websockets
Send a binary message. This is useful for sending binary blobs, e.g.
images, data encoded with MessagePack, images...
Send a number of binary messages. This is more efficient than calling
sendBinaryData many times.
Send a friendly close message. Note that after sending this message,
you should still continue calling
receiveDataMessage to process
any in-flight messages. The peer will eventually respond with a close
control message of its own which will cause
receiveDataMessage
to throw the
CloseRequest exception. This exception is when you
can finally consider the connection closed.
Send a textual message. The message will be encoded as UTF-8. This
should be the default choice for human-readable text-based protocols
such as JSON.
Send a number of textual messages. This is more efficient than calling
sendTextData many times.