-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProtocol.java
More file actions
64 lines (50 loc) · 1.26 KB
/
Protocol.java
File metadata and controls
64 lines (50 loc) · 1.26 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
52
53
54
55
56
57
58
59
60
61
62
63
package tpp;
public class Protocol
{
/**
* CHANGE.
*/
/**
* Port number that is used for TCP-tunnels.
* <br><i>Application layer</i>
*/
public final static int PORT = 1337;
public final static int MAX_FILE_SIZE = -1;
/**
* Chat messages should start with this prefix.
* <br><i>Application layer</i>
*/
public final static char CHAT_PREFIX = 'C';
/**
* File messages should start with this prefix.
* <br><i>Application layer</i>
*/
public final static char FILE_PREFIX = 'F';
/**
* Accept messages should start with this prefix.
* <br><i>Application layer</i>
*/
public final static char ACCEPT_PREFIX = 'A';
/**
* Send messages should start with this prefix.
* <br><i>Application layer</i>
*/
public final static char SEND_PREFIX = 'S';
/**
* Size of the frame packet (in bytes).
* <br><i>Transport/Network layer</i>
*/
public final int HEADER_SIZE = 20;
/**
* Maximum size of the packet payload (in bytes).
*/
public final int MAX_PAYLOAD_SIZE = 1024;
/**
* Maximum size of the entire packet (in bytes).
*/
public final int MAX_FRAME_SIZE = HEADER_SIZE + MAX_PAYLOAD_SIZE;
/**
* Time after which an outgoing package is assumed to have been lost (in seconds).
*/
public final int TIMEOUT = 60;
}