WebSocketSession
A WebSocket session between two peers.
Inheritors
Properties
Functions
Sends a close frame with the specified reason. May suspend if the outgoing channel is full. The specified reason could be ignored if there was already close frame sent (for example in reply to a peer close frame). It also may do nothing when a session or an outgoing channel is already closed due to any reason.
Closes a session with normal or error close reason, depending on whether cause is cancellation or not.
Finds the extensions using WebSocketExtensionFactory.
Searches the extensions using WebSocketExtensionFactory.
Flushes all outstanding messages and suspends until all earlier sent messages will be written. Could be called at any time even after close. May return immediately if the connection is already terminated. However, it may also fail with an exception (or cancellation) at any point due to a session failure. Note that flush doesn't guarantee that frames were actually delivered.
Enqueue a frame, may suspend if an outgoing queue is full. May throw an exception if the outgoing channel is already closed, so it is impossible to transfer any message. Frames that were sent after close frame could be silently ignored. Note that a close frame could be sent automatically in reply to a peer's close frame unless it is raw WebSocket session.