Class PingMessage
- java.lang.Object
-
- xdevs.core.simulation.distributed.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 Summary
Fields Modifier and Type Field Description static String
DEFAULT_DESTINATION_HOST
Default destination host.static int
DEFAULT_DESTINATION_PORT
Default destination port.
-
Constructor Summary
Constructors Constructor Description PingMessage(MessageDistributed message)
Constructor for the ping message.PingMessage(MessageDistributed message, String destinationHost, int destinationPort)
Constructor for the ping message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageDistributed
ping()
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 pingdestinationHost
- Destination host for the pingdestinationPort
- 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
-
-