run method

dynamic run()

Implementation

run() async {
  runZonedGuarded(() async {
    var server = await HttpServer.bind('127.0.0.1', 4040);
    await for (var req in server) {
      // Upgrade a HttpRequest to a WebSocket connection.
      var socket = await WebSocketTransformer.upgrade(req);

      socket.listen(handleMsg);
    }
  }, (e, s) => print(e)); // Will print "asynchronous error".
}