randomPortFallback top-level property

Null Function(SimpleWebServer sws, WebSocketHandler wsHandler) randomPortFallback
read / write

Implementation

var randomPortFallback = (SimpleWebServer sws, WebSocketHandler wsHandler) {
  var rng = new Random();
  var newPortNumber = rng.nextInt(8888) + 1000;

  sws.port = newPortNumber;
  sws.start(handleWs: wsHandler);
};