From ecb007584a8b45bb06290c5e552a04ad109eacb9 Mon Sep 17 00:00:00 2001 From: flavien Date: Wed, 18 Mar 2020 15:59:34 +0100 Subject: [PATCH] added execptions --- src/clientP2P/ClientDownloadPartTCP.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/clientP2P/ClientDownloadPartTCP.java b/src/clientP2P/ClientDownloadPartTCP.java index 885fcbf..11a277c 100644 --- a/src/clientP2P/ClientDownloadPartTCP.java +++ b/src/clientP2P/ClientDownloadPartTCP.java @@ -97,7 +97,11 @@ public class ClientDownloadPartTCP implements Runnable { } } System.err.println("Closing socket"); - socket.close(); + try{ + socket.close(); + } catch(IOException e){ + System.err.println("can't close socket"); + } } /** Get list of offsets that have not be downloaded if failed, else @@ -216,6 +220,9 @@ public class ClientDownloadPartTCP implements Runnable { e.printStackTrace(); System.err.println("Error: reqPart ioexception"); return null; + } catch (SocketClosed e){ + System.err.println("Error: reqPart SocketClosed"); + return null; } }