static void Main(string[] args) { RC4Encryption rc4Server = new RC4Encryption(); RC4Encryption rc4Client = new RC4Encryption(); rc4Server.makeSBox("zhangyawei"); rc4Client.makeSBox("zhangyawei"); TestIntegerData idata = new TestIntegerData('a', 1, 5, 20, 30, 40, 50, 60, 70); TestFloatData fdata = new TestFloatData(243.123123f, 32432.123); TestStringData sdata = new TestStringData("love"); EchoPack pack = new EchoPack(); pack._iarray = new Proto4z.TestIntegerDataArray(); pack._iarray.Add(idata); pack._iarray.Add(idata); pack._iarray.Add(idata); pack._farray = new Proto4z.TestFloatDataArray(); pack._farray.Add(fdata); pack._farray.Add(fdata); pack._farray.Add(fdata); pack._sarray = new Proto4z.TestStringDataArray(); pack._sarray.Add(sdata); pack._sarray.Add(sdata); pack._sarray.Add(sdata); pack._imap = new Proto4z.TestIntegerDataMap(); pack._imap.Add("123", idata); pack._imap.Add("223", idata); pack._fmap = new Proto4z.TestFloatDataMap(); pack._fmap.Add("523", fdata); pack._fmap.Add("623", fdata); pack._smap = new Proto4z.TestStringDataMap(); pack._smap.Add("723", sdata); pack._smap.Add("823", sdata); var now = DateTime.UtcNow; for (int i = 0; i < 1; i++) { var byteData = pack.__encode(); var binData = byteData.ToArray(); // for (int i = 0; i < binData.Length; i++) // { // System.Console.WriteLine((int)binData[i]); // } rc4Server.encryption(binData, binData.Length); rc4Client.encryption(binData, binData.Length); // for (int i = 0; i < binData.Length; i++) // { // System.Console.WriteLine((int)binData[i]); // } var v = new EchoPack(); int pos = 0; v.__decode(binData, ref pos); Client client = new Client(); client.Run(binData); } System.Console.WriteLine(DateTime.UtcNow - now); }
static void Main(string[] args) { RC4Encryption rc4Server = new RC4Encryption(); RC4Encryption rc4Client = new RC4Encryption(); rc4Server.makeSBox("zhangyawei"); rc4Client.makeSBox("zhangyawei"); TestIntegerData idata = new TestIntegerData('a', 1, 5, 20, 30, 40, 50, 60, 70); TestFloatData fdata = new TestFloatData(243.123123f, 32432.123); TestStringData sdata = new TestStringData("love"); EchoPack pack = new EchoPack(); pack._iarray = new Proto4z.TestIntegerDataArray(); pack._iarray.Add(idata); pack._iarray.Add(idata); pack._iarray.Add(idata); pack._farray = new Proto4z.TestFloatDataArray(); pack._farray.Add(fdata); pack._farray.Add(fdata); pack._farray.Add(fdata); pack._sarray = new Proto4z.TestStringDataArray(); pack._sarray.Add(sdata); pack._sarray.Add(sdata); pack._sarray.Add(sdata); pack._imap = new Proto4z.TestIntegerDataMap(); pack._imap.Add("123", idata); pack._imap.Add("223", idata); pack._fmap = new Proto4z.TestFloatDataMap(); pack._fmap.Add("523", fdata); pack._fmap.Add("623", fdata); pack._smap = new Proto4z.TestStringDataMap(); pack._smap.Add("723", sdata); pack._smap.Add("823", sdata); var now = DateTime.UtcNow; for (int i=0; i< 1; i++) { var byteData = pack.__encode(); var binData = byteData.ToArray(); // for (int i = 0; i < binData.Length; i++) // { // System.Console.WriteLine((int)binData[i]); // } rc4Server.encryption(binData, binData.Length); rc4Client.encryption(binData, binData.Length); // for (int i = 0; i < binData.Length; i++) // { // System.Console.WriteLine((int)binData[i]); // } var v = new EchoPack(); int pos = 0; v.__decode(binData, ref pos); Client client = new Client(); client.Run(binData); } System.Console.WriteLine(DateTime.UtcNow - now); }