private void btnStart_Click(object sender, RoutedEventArgs e)
 {
     if (server.Running) return;
     ServerInfo info = new ServerInfo(Opt.AuthServer.Port,
          Opt.AuthServer.IP);
     server.Listen(info);
 }
        public AuthMainWin()
        {
            InitializeComponent();

            server = new SocketWrapper();
            server.OnAccept += new SocketWrapper.dlgAccept(m_auth_OnAccept);
            server.OnRead += new SocketWrapper.dlgRead(m_auth_OnRead);
            server.OnClose += new SocketWrapper.dlgClose(server_OnClose);

            Logger _writer = new Logger(tLog);

            Opt = Settings.Deserialize();
            if (Opt.AuthServer.AutoStart)
            {
                ServerInfo info = new ServerInfo(Opt.AuthServer.Port, Opt.AuthServer.IP);
                server.Listen(info);
            }
        }
Example #3
0
 public void Listen(ServerInfo info)
 {
     if (tWorker != null)
     {
         if (tWorker.ThreadState != ThreadState.Aborted)
             return;
     }
     tWorker = new Thread(new ParameterizedThreadStart(Start));
     tWorker.IsBackground = true;
     tWorker.Start(info);
 }