コード例 #1
0
        private static void SendData(ICommunicationManager communicationManager)
        {
            // Having less than the buffer size in SocketConstants.BUFFERSIZE.
            var dataBytes = new byte[2048];

            for (int i = 0; i < dataBytes.Length; i++)
            {
                dataBytes[i] = 0x65;
            }

            var dataBytesStr = Encoding.UTF8.GetString(dataBytes);

            for (int i = 0; i < 5; i++)
            {
                communicationManager.SendRawMessage(dataBytesStr);
            }
        }
コード例 #2
0
ファイル: SocketTests.cs プロジェクト: zcsizmadia/vstest
        private static void SendData2(ICommunicationManager communicationManager, Stopwatch watch)
        {
            var dataBytes = new byte[65536];

            for (int i = 0; i < dataBytes.Length; i++)
            {
                dataBytes[i] = 0x65;
            }

            var dataBytesStr = System.Text.Encoding.UTF8.GetString(dataBytes);

            watch.Start();
            for (int i = 0; i < 20000; i++)
            {
                communicationManager.SendRawMessage(dataBytesStr);
            }
        }