private void ServerWork() { try { Application.DoEvents(); ServerBehaviour b = new ServerBehaviour(); b.MessageReceived += OnMessageReceived; b.SessionCompleted += OnSessionCompleted; _server = new Server(b); _server.Run(); } catch (Exception exception) { Invoke((MethodInvoker)(() => { StopServer(); statusLabel.Text = "Server failed: " + exception.Message; trayIcon.ShowBalloonTip(3000, "Server failed", exception.Message, ToolTipIcon.Error); })); } }
public ServerController() { Behaviour = new ServerBehaviour(); IsRunning = false; }