WebSocketSession constructor

WebSocketSession(
  1. WebSocketChannel channel,
  2. Request request, {
  3. String? negotiatedProtocol,
})

Wraps channel, opened by request.

negotiatedProtocol is what the handshake settled on. shelf_web_socket reports it alongside the channel rather than on it, and a server-side channel leaves WebSocketChannel.protocol null, so it is carried here.

Implementation

WebSocketSession(this.channel, this.request, {String? negotiatedProtocol})
    : _negotiatedProtocol = negotiatedProtocol;