![]()  | 
  
    Qore WebSocketHandler Module Reference
    1.5.2
    
   | 
 
this class represents a connection to a websocket client More...
Public Member Methods | |
| connectionClosed () | |
| this method is called by the WebSocketHandler when the connection is closed  More... | |
| constructor (WebSocketHandler handler) | |
| the constructor is called by the WebSocketHandler when a new connection is made by a websocket client; it is called from WebSocketHandler::getConnectionImpl(), which can be overridden in subclasses to allow a subclass of this class to be used as the connection object  | |
| flush () | |
| Flush all output data.  More... | |
| gotMessage (binary msg) | |
| this method is called by the WebSocketHandler when messages from the client are received  More... | |
| gotMessage (string msg) | |
| this method is called by the WebSocketHandler when messages from the client are received  More... | |
| int | gotRawMessage (hash< WsMsgInfo > msg) | 
| This method is called when a message is received.  More... | |
| *binary | pollData () | 
| this method is called by the WebSocketHandler to poll for messages from the client to send from the server  | |
| *binary | pollDataImmediate () | 
| this method is called by the WebSocketHandler to poll for messages from the client to send from the server  | |
| registered () | |
| called when the connection has been registered in handler and accept sending messages (e.g. to send initial welcome message); the default implementation does nothing  More... | |
| send (data msg) | |
| pushes an unencoded message on the connection's message queue; the message will be encoded with WebSocketUtil::ws_encode_message() before sending  | |
| send (data msg, int op, bool fin) | |
| pushes an unencoded message on the connection's message queue; the message will be encoded with WebSocketUtil::ws_encode_message() before sending  | |
| sendEncoded (binary msg) | |
| pushes an already-encoded message on the connection's message queue  | |
| setSocket (Socket sock) | |
| Sets the socket used by the server for the connection.  | |
| stop () | |
| force closing socket related to connection  | |
Public Attributes | |
| WebSocketHandler | handler | 
| The parent handler object.  | |
| bool | stop_flag = False | 
| Stop connection flag.  | |
Private Member Methods | |
| Qore::Thread::Queue | queue () | 
| the Queue object stores messages to be sent to the server  | |
Private Attributes | |
| int | tid = gettid() | 
| The TID of the I/O thread.  | |
Private:Internal Attributes | |
| Socket | sock | 
| The socket used by the server for this connection.  | |
this class represents a connection to a websocket client
| WebSocketHandler::WebSocketConnection::connectionClosed | ( | ) | 
this method is called by the WebSocketHandler when the connection is closed
the implementation in this class is empty; implement this method in a subclass to provide custom behavior
| WebSocketHandler::WebSocketConnection::flush | ( | ) | 
Flush all output data.
| WebSocketHandler::WebSocketConnection::gotMessage | ( | binary | msg | ) | 
this method is called by the WebSocketHandler when messages from the client are received
the implementation in this class is empty; implement this method in a subclass to provide custom behavior
| WebSocketHandler::WebSocketConnection::gotMessage | ( | string | msg | ) | 
this method is called by the WebSocketHandler when messages from the client are received
the implementation in this class is empty; implement this method in a subclass to provide custom behavior
This method is called when a message is received.
| msg | the raw message information | 
| WebSocketHandler::WebSocketConnection::registered | ( | ) | 
called when the connection has been registered in handler and accept sending messages (e.g. to send initial welcome message); the default implementation does nothing