WsSession
struct WsSessionOne upgraded connection as a handler sees it.
Implements Movable
- Fields
proto: WsProtocolpeer: SocketAddrorigin: String: The handshake'sOrigin(the last one if repeated), or"".
__init__
def __init__(out self, peer: SocketAddr, var origin: String, max_message: Int, max_outbox: Int) send_text
def send_text(mut self, msg: String) Queue a TEXT message. Raises after a CLOSE, and when the peer is too far behind (the session then closes with 1008).
send_binary
def send_binary(mut self, data: List[UInt8]) Queue a BINARY message; raises as :meth:send_text does.
close
def close(mut self, code: UInt16 = UInt16(1000)) Start the closing handshake.