-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPingRequest.java
More file actions
51 lines (45 loc) · 1.12 KB
/
PingRequest.java
File metadata and controls
51 lines (45 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* <pre>
* Class that stores information about a Ping request that was sent
* </pre>
*/
public class PingRequest {
private int destAddr;
private byte[] msg;
private long timeSent;
/**
* Initialize member variables
* @param destAddr The address of the destination host
* @param msg The message that was sent
* @param timeSent The time that the ping was sent
*/
public PingRequest(int destAddr, byte[] msg, long timeSent) {
this.destAddr = destAddr;
this.msg = msg;
this.timeSent = timeSent;
}
/**
* @return The address of the destination host
*/
public int getDestAddr() {
return this.destAddr;
}
/**
* @return The message that was sent in the Ping
*/
public byte[] getMsg() {
return this.msg;
}
/**
* @return The time that the ping was sent
*/
public long getTimeSent() {
return this.timeSent;
}
/**
* @return String representation
*/
public String toString() {
return new String("Dest: " + destAddr + " Send Time: " + timeSent + " Message: " + Utility.byteArrayToString(msg));
}
}