예제 #1
0
 private void ReceiveSorketTarTCP(IAsyncResult result)
 {
     try
     {
         var tcp = (TcpClient)result.AsyncState;
         tarTCPSize = tcp.Client.EndReceive(result);
         if (tarTCPSize > 0)
         {
             if (tarMask)
             {
                 Socks5Util.Mask(server.deMaskNum, tarTCPBody, tarTCPSize);
             }
             if (srcMask)
             {
                 Socks5Util.Mask(server.enMaskNum, tarTCPBody, tarTCPSize);
             }
             srcTCP.Client.Send(tarTCPBody, tarTCPSize, SocketFlags.None);
             ReceiveSorketTarTCPLoop();
         }
         else
         {
             Stop();
         }
     }
     catch (Exception e)
     {
         //DebugUtil.Error("Failed to ReceiveSorketSrc error." + e);
         Stop();
     }
 }
예제 #2
0
 private void SrcSendData(byte[] bytes)
 {
     if (srcMask)
     {
         Socks5Util.Mask(server.enMaskNum, bytes, bytes.Length);
     }
     srcTCP.Client.Send(bytes);
 }
예제 #3
0
 private void SrcRecvData()
 {
     srcTCPSize = srcTCP.Client.Receive(srcTCPBody);
     if (srcMask)
     {
         Socks5Util.Mask(server.deMaskNum, srcTCPBody, srcTCPSize);
     }
 }