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(); } }
private void SrcSendData(byte[] bytes) { if (srcMask) { Socks5Util.Mask(server.enMaskNum, bytes, bytes.Length); } srcTCP.Client.Send(bytes); }
private void SrcRecvData() { srcTCPSize = srcTCP.Client.Receive(srcTCPBody); if (srcMask) { Socks5Util.Mask(server.deMaskNum, srcTCPBody, srcTCPSize); } }