/// <summary> /// Generates the Echo message to send. /// </summary> /// <returns>An array of bytes that represents the ICMP echo message to send.</returns> protected byte[] GetEchoMessageBuffer() { EchoMessage message = new EchoMessage(); message.Type = 8; // ICMP echo message.Data = new Byte[32]; for (int i = 0; i < 32; i++) { message.Data[i] = 32; // Send spaces } message.CheckSum = message.GetChecksum(); return message.GetObjectBytes(); }
/// <summary> /// Generates the Echo message to send. /// </summary> /// <returns>An array of bytes that represents the ICMP echo message to send.</returns> protected byte[] GetEchoMessageBuffer() { EchoMessage message = new EchoMessage(); message.Type = 8; // ICMP echo message.Data = new Byte[32]; for (int i = 0; i < 32; i++) { message.Data[i] = 32; // Send spaces } message.CheckSum = message.GetChecksum(); return(message.GetObjectBytes()); }
/// <summary> /// Generates the Echo message to send. /// </summary> /// <returns>An array of bytes that represents the ICMP echo message to send.</returns> protected byte[] GetEchoMessageBuffer(int weight) { if (weight < 1) { weight = 1; } EchoMessage message = new EchoMessage(); message.Type = 8; // ICMP echo message.Data = new Byte[1 * weight]; for (int i = 0; i < weight; i++) { message.Data[i] = 32; // Send spaces } message.CheckSum = message.GetChecksum(); return(message.GetObjectBytes()); }