From 98c6a8cf92eb67c32df9cfe9adfe926503083e2b Mon Sep 17 00:00:00 2001 From: flavien Date: Wed, 18 Mar 2020 15:47:34 +0100 Subject: [PATCH] corrected some issues --- src/clientP2P/ClientDownloadPartTCP.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/clientP2P/ClientDownloadPartTCP.java b/src/clientP2P/ClientDownloadPartTCP.java index 5f1ab04..86bd69c 100644 --- a/src/clientP2P/ClientDownloadPartTCP.java +++ b/src/clientP2P/ClientDownloadPartTCP.java @@ -21,6 +21,7 @@ import java.nio.file.Files; import java.io.File; import java.nio.file.Paths; import java.io.IOException; +import exception.SocketClosed; /** Class to download file parts on tcp. * @author Louis Royer @@ -48,7 +49,7 @@ public class ClientDownloadPartTCP implements Runnable { * @param socket socket to use * @param partsSubdir directory to store .part files */ - public ClientDownloadPartTCP(ClientDownloadTCP manager, String filename, DatagramSocket socket, String partsSubdir) { + public ClientDownloadPartTCP(ClientDownloadTCP manager, String filename, Socket socket, String partsSubdir) { this.manager = manager; this.partsSubdir = partsSubdir; this.filename = filename; @@ -299,6 +300,9 @@ public class ClientDownloadPartTCP implements Runnable { } catch (InternalError e) { System.err.println("Error: downloadPart internalError"); return true; + } catch (SocketClosed e){ + System.err.println("Error: downloadPart SocketClosed"); + return true; } return false; }