All Classes Functions Variables
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
com.server.HandleUDP Class Reference

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
 

Detailed Description

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.

Author
William Daniels
Version
1.1

Constructor & Destructor Documentation

com.server.HandleUDP.HandleUDP ( DatagramSocket  client,
int  whichPort 
)
inline

constructor for the class, takes two parameters, as well as starts the thread.

Parameters
clientThe DatagramSocket that is connected to.
whichPortan int that tells which port has been passed in.

Member Function Documentation

void com.server.HandleUDP.uploadBlackHole ( )
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.


The documentation for this class was generated from the following file: