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); } }
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); } }