|
|
|
@ -68,7 +68,7 @@ public class ServerManagementTCP implements Runnable {
|
|
|
|
|
try {
|
|
|
|
|
Socket s = socket.accept();
|
|
|
|
|
System.err.println("Accepting new connection");
|
|
|
|
|
while(true) {
|
|
|
|
|
do {
|
|
|
|
|
try {
|
|
|
|
|
ProtocolP2PPacketTCP pd = new ProtocolP2PPacketTCP((Object)s);
|
|
|
|
|
Payload p = pd.getPayload();
|
|
|
|
@ -139,14 +139,17 @@ public class ServerManagementTCP implements Runnable {
|
|
|
|
|
default:
|
|
|
|
|
sendInternalError(pd);
|
|
|
|
|
}
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
} catch (TransmissionError e) {
|
|
|
|
|
} catch (ProtocolError e) {
|
|
|
|
|
} catch (VersionError e) {
|
|
|
|
|
} catch (InternalError e) {
|
|
|
|
|
} catch (SizeError e) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (SocketException e) {
|
|
|
|
|
System.out.println("connection closed");
|
|
|
|
|
s.close();
|
|
|
|
|
}
|
|
|
|
|
catch (IOException e) {}
|
|
|
|
|
catch (TransmissionError e) {}
|
|
|
|
|
catch (ProtocolError e) {}
|
|
|
|
|
catch (VersionError e) {}
|
|
|
|
|
catch (InternalError e) {}
|
|
|
|
|
catch (SizeError e) {}
|
|
|
|
|
} while(true);
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -168,8 +171,6 @@ public class ServerManagementTCP implements Runnable {
|
|
|
|
|
Arrays.sort(fileList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Send an internal error message.
|
|
|
|
|
* @param pd ProtocolP2PPacketTCP to respond
|
|
|
|
|
*/
|
|
|
|
@ -182,4 +183,3 @@ public class ServerManagementTCP implements Runnable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|