Class | EventMachine::WebSocket::Connection |
In: |
lib/em-websocket/connection.rb
|
Parent: | EventMachine::Connection |
ENCODING_SUPPORTED | = | "string".respond_to?(:force_encoding) | Cache encodings since it‘s moderately expensive to look them up each time | |
UTF8 | = | Encoding.find("UTF-8") if ENCODING_SUPPORTED | ||
BINARY | = | Encoding.find("BINARY") if ENCODING_SUPPORTED |
max_frame_size | [W] |
Use this method to close the websocket connection cleanly This sends a close frame and waits for acknowlegement before closing the connection
Returns the maximum frame size which this connection is configured to accept. This can be set globally or on a per connection basis, and defaults to a value of 10MB if not set.
The behaviour when a too large frame is received varies by protocol, but in the newest protocols the connection will be closed with the correct close code (1009) immediately after receiving the frame header
Send a WebSocket text frame.
A WebSocketError may be raised if the connection is in an opening or a closing state, or if the passed in data is not valid UTF-8