Пример #1
0
        private void startSvrBtn_Click(object sender, EventArgs e)
        {
            try
            {
                if(neatoServerThread == null || !neatoServerThread.IsAlive) {
                    dLog.Debug("Creating Connection Manger object");
                    neatoServer = new ConnectionManager();
                    neatoServer.StatusUpdate += new EventHandler<MessageArgs>(OnStatusUpdate);
                    neatoServerThread = new Thread(neatoServer.startServer);
                    neatoServerThread.Name = "Server Thread";
                }

                dLog.Debug("Starting server thread");
                neatoServerThread.Start();
                startSvrBtn.Enabled = false;
                stopSvrBtn.Enabled = true;
            }
            catch (Exception e1)
            {
                dLog.Error("Exception in startSvrBtn_Click: " + e1.Message + "\n" + e1.StackTrace);
            }
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="socket"></param>
 /// <param name="_par"></param>
 public SocketManager(Socket socket, ConnectionManager _par)
 {
     setDefaults();
     this.socket = socket;
     this.parent = _par;
 }