This class handles most the primary UDP Upload and Download functionality for the server. More...
Public Member Functions | |
| HandleUDP (DatagramSocket client, int whichPort) | |
| constructor for the class, takes two parameters, as well as starts the thread. More... | |
| void | run () |
| simply chooses a port and runs it. | |
Private Member Functions | |
| void | uploadBlackHole () |
| This method handles all of the upload logic for the UDP protocol. More... | |
| void | downloadDataDump () |
Private Attributes | |
| final Map< String, TimeStampValue > | addressTable |
| final DatagramSocket | client |
| final int | whichPort |
Static Private Attributes | |
| static final int | ONE_MINUTE_IN_MILLISECONDS = 60000 |
| static final int | MAXIMUM_PACKET_SIZE = 30 * 1024 |
This class handles most the primary UDP Upload and Download functionality for the server.
All of the various handling of packets, whether it be dumping or recieving is handled inside. A side note: ALL of the methods used for building the 'willdp' aka: the baby protocol on top of UDP the server uses to specifically consider '0' (that is, the char value of 0), to be the finishing bit for the connection. once that is reached, the respective sender is expected to send, in this order: a packet containing the ipAddress to bind to, as well as a port number.
|
inline |
constructor for the class, takes two parameters, as well as starts the thread.
| client | The DatagramSocket that is connected to. |
| whichPort | an int that tells which port has been passed in. |
|
inlineprivate |
This method handles all of the upload logic for the UDP protocol.
When a connection is made to it, it 'black holes' all of the given information, and disposes it. It waits until the exit character (0) is sent to it, and then tries to connect to a remote host with the next two packets.
1.8.4