예제 #1
0
 public override void OnAccept(IAsyncResult ar)
 {
     try
     {
         Socket NewSocket = ListenSocket.EndAccept(ar);
         if (NewSocket != null)
         {
             ProxyClient NewClient = new ProxyClient(Config, NewSocket, new DestroyDelegate(this.RemoveClient));
             AddClient(NewClient);
             NewClient.StartHandshake();
         }
     }
     catch { }
     try
     {
         //Restart Listening
         ListenSocket.BeginAccept(new AsyncCallback(this.OnAccept), ListenSocket);
     }
     catch
     {
         Dispose();
     }
 }
예제 #2
0
 public override void OnAccept(IAsyncResult ar)
 {
     try
     {
         Socket NewSocket = ListenSocket.EndAccept(ar);
         if (NewSocket != null)
         {
             ProxyClient NewClient = new ProxyClient(Config, NewSocket, new DestroyDelegate(this.RemoveClient));
             AddClient(NewClient);
             NewClient.StartHandshake();
         }
     }
     catch { }
     try
     {
         //Restart Listening
         ListenSocket.BeginAccept(new AsyncCallback(this.OnAccept), ListenSocket);
     }
     catch
     {
         Dispose();
     }
 }