private static void StartBrokerForm(object ipAndPort) { BrokerController brokerController = new BrokerController(); BrokerGUI brokerGUI = new BrokerGUI(brokerController, (string)ipAndPort); brokerController.RegisterGUI(createGUIWrapper(brokerGUI)); var wssv = new WebSocketServer(8008); wssv.AddWebSocketService("/BrokerController", () => { var server = new WebServer(createControllerWrapper(brokerController)); brokerController.RegisterBoundary(server.BroadcastMessage); return(server); }); wssv.Start(); Application.Run(brokerGUI); }