WebSocketServer constructor

WebSocketServer({
  1. int port = 8080,
  2. required void cmdCallBackFunction(
    1. String message
    ),
  3. required void fileCallBackFunction(
    1. dynamic data
    ),
  4. required void clientsListCallBack(
    1. List<WebSocket> clients
    ),
})

Constructor for WebSocketServer that initializes the server with a port and callback functions.

port: The port number on which the WebSocket server will listen. Default is 8080. cmdCallBackFunction: A function that will be called whenever a message is received from any client.

Implementation

WebSocketServer({
  this.port = 8080,
  required this.cmdCallBackFunction,
  required this.fileCallBackFunction,
  required this.clientsListCallBack,
});