|
|
@ -84,7 +84,7 @@ public class ServerManagementUDP implements Runnable {
|
|
|
|
Payload p = pd.getPayload();
|
|
|
|
Payload p = pd.getPayload();
|
|
|
|
switch (p.getRequestResponseCode()) {
|
|
|
|
switch (p.getRequestResponseCode()) {
|
|
|
|
case LOAD_REQUEST:
|
|
|
|
case LOAD_REQUEST:
|
|
|
|
loadRequestManagement(p, pd);
|
|
|
|
loadRequestManagement(pd);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case LIST_REQUEST:
|
|
|
|
case LIST_REQUEST:
|
|
|
|
listRequestManagement(pd);
|
|
|
|
listRequestManagement(pd);
|
|
|
@ -158,7 +158,11 @@ public class ServerManagementUDP implements Runnable {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void loadRequestManagement(Payload p, ProtocolP2PPacketUDP pd){
|
|
|
|
/** Respond to LOAD requests
|
|
|
|
|
|
|
|
* @param pd ProtocolP2PPacketUDP
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public void loadRequestManagement(ProtocolP2PPacketUDP pd){
|
|
|
|
|
|
|
|
Payload p = pd.getPayload();
|
|
|
|
logger.writeUDP("Received LOAD_REQUEST", LogLevel.Action);
|
|
|
|
logger.writeUDP("Received LOAD_REQUEST", LogLevel.Action);
|
|
|
|
assert p instanceof LoadRequest : "payload must be an instance of LoadRequest";
|
|
|
|
assert p instanceof LoadRequest : "payload must be an instance of LoadRequest";
|
|
|
|
if (!(p instanceof LoadRequest)) {
|
|
|
|
if (!(p instanceof LoadRequest)) {
|
|
|
@ -208,6 +212,9 @@ public class ServerManagementUDP implements Runnable {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Respond to LIST requests
|
|
|
|
|
|
|
|
* @param pd ProtocolP2PPacketUDP
|
|
|
|
|
|
|
|
*/
|
|
|
|
public void listRequestManagement(ProtocolP2PPacketUDP pd) {
|
|
|
|
public void listRequestManagement(ProtocolP2PPacketUDP pd) {
|
|
|
|
logger.writeUDP("Received LIST_REQUEST", LogLevel.Action);
|
|
|
|
logger.writeUDP("Received LIST_REQUEST", LogLevel.Action);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|