public WebServer(int port)
 {
     new System.Threading.Thread(()=> {
         socketServer = new SocketServerBase(port);
         socketServer.OnRead += new SocketServerBase.ConnectionDelegate(socketServer_OnRead);
         socketServer.Active();
         socketServer.OnConnect += (soc) =>
         {
             connections.Add(socketServer.IndexOf(soc), false);
             MainWindow.This.Log("Pair connected. Idx: " + socketServer.IndexOf(soc).ToString() + ", conns: " + socketServer.ActiveConnections.ToString());
         };
         socketServer.OnDisconnect += (soc) =>
         {
             connections.Remove(socketServer.IndexOf(soc));
             MainWindow.This.Log("Pair disconnected. Idx: " + socketServer.IndexOf(soc).ToString() + ", conns: " + socketServer.ActiveConnections.ToString());
         };
     }).Start();
 }
Beispiel #2
0
 public WebServer(int port)
 {
     new System.Threading.Thread(() => {
         socketServer         = new SocketServerBase(port);
         socketServer.OnRead += new SocketServerBase.ConnectionDelegate(socketServer_OnRead);
         socketServer.Active();
         socketServer.OnConnect += (soc) =>
         {
             connections.Add(socketServer.IndexOf(soc), false);
             MainWindow.This.Log("Pair connected. Idx: " + socketServer.IndexOf(soc).ToString() + ", conns: " + socketServer.ActiveConnections.ToString());
         };
         socketServer.OnDisconnect += (soc) =>
         {
             connections.Remove(socketServer.IndexOf(soc));
             MainWindow.This.Log("Pair disconnected. Idx: " + socketServer.IndexOf(soc).ToString() + ", conns: " + socketServer.ActiveConnections.ToString());
         };
     }).Start();
 }