Esempio n. 1
0
        /// <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());
        }
Esempio n. 2
0
 /// <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();
 }