Introduction | Setup | Peer | Server | Centralised | DHT | Presentation | Architecture-Basic | Architecture-Operation |
This program works via both UDP or TCP. Despite the method of transmission, information is sent in the following manner:
Each packet or "communication" is sent as an Java ArrayList (that has been converted in a string of bits).
The first entry in the ArrayList (index 0) is the "header" of the communication. It briefly describes the purpose of the communication (whether we're registering, sending messages, etc).
Every other entry in the ArrayList is other information that is going to be used by the receiver. A communication could conceivably be ONLY a header.
An example of a peer string could be:
"Alex;192.xxx.xxx.xxx;5000:User1;192.xxx.xxx.xxx;5001:User2;192.xxx.xxx.xxx;5002"