Class PingMessage


  • public class PingMessage
    extends Object
    Class to transmit a message to a remote host and receive the response. This class implements a message to be transmitted to a remote host. It contains a message and a destination host and port. It also contains a method to send the message and receive the response.
    • Field Detail

      • DEFAULT_DESTINATION_HOST

        public static final String DEFAULT_DESTINATION_HOST
        Default destination host.
        See Also:
        Constant Field Values
      • DEFAULT_DESTINATION_PORT

        public static final int DEFAULT_DESTINATION_PORT
        Default destination port.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PingMessage

        public PingMessage​(MessageDistributed message,
                           String destinationHost,
                           int destinationPort)
        Constructor for the ping message.
        Parameters:
        message - Message for the ping
        destinationHost - Destination host for the ping
        destinationPort - Destination port for the ping
      • PingMessage

        public PingMessage​(MessageDistributed message)
        Constructor for the ping message.
        Parameters:
        message - Message for the ping
    • Method Detail

      • ping

        public MessageDistributed ping()
        Send the message and receive the response.
        Returns:
        The response to the message