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 friendly close message and close code. Similar to sendClose, you should continue calling receiveDataMessage until you receive a CloseRequest exception. See http://tools.ietf.org/html/rfc6455#section-7.4 for a list of close codes.
Send a Message. This allows you send both human-readable text and binary data. This is a slightly more low-level interface than sendTextData or sendBinaryData.
Send a collection of Messages. This is more efficient than calling sendDataMessage many times.
Send a ping
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.
Send a pong