예제 #1
0
        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);
                }));
            }
        }
예제 #2
0
        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);
                                            }));
            }
        }
예제 #3
0
 public ServerController()
 {
     Behaviour = new ServerBehaviour();
     IsRunning = false;
 }