WebSocketTransport

@unitybase/ub/web-sockets~ WebSocketTransport

Internal server-side WebSocket transport layer, which communicates with clients using low-level binding classes. Usually there is no need to use this class directly, it is better to use an instance of JsonMessagesProtocol from UB.wsNotifier

Server emits three types of event on the protocol level:

  • connect, parameters are: ({WebSocketConnection} wsConn)
  • disconnect, parameters are: ({WebSocketConnection} wsConn, {String} closeReason, {Number} closeStatus) http://tools.ietf.org/html/rfc6455#section-7.4
  • message, parameters are: ({WebSocketConnection} wsConn, {String|ArrayBudder} message)