コード例 #1
0
 protected override void AcceptCallback(IAsyncResult ar)
 {
     try
     {
         Socket localSocket = ListenerSocket.EndAccept(ar);
         if (localSocket != null)
         {
             var client = new SocksClient(localSocket, Subscribe, Remove, AuthCallback);
             client.StartHandshake();
         }
     }
     catch
     {}
     try
     {
         ListenerSocket.BeginAccept(AcceptCallback, null);
     }
     catch
     {
         Dispose();
     }
 }
コード例 #2
0
ファイル: SocksServer.cs プロジェクト: hepper/ProxyKit
 protected override void AcceptCallback(IAsyncResult ar)
 {
     try
     {
         Socket localSocket = ListenerSocket.EndAccept(ar);
         if(localSocket != null)
         {
             var client = new SocksClient(localSocket, Subscribe, Remove, AuthCallback);
             client.StartHandshake();
         }
     }
     catch
     {}
     try
     {
         ListenerSocket.BeginAccept(AcceptCallback, null);
     }
     catch
     {
         Dispose();
     }
 }