From 9369176432da1ace725062e3bb14ac6c3c5b1386 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 18 Mar 2020 18:31:15 +0100 Subject: [PATCH] Fix server start Fix printing --- src/clientP2P/ClientP2P.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/clientP2P/ClientP2P.java b/src/clientP2P/ClientP2P.java index c6f8b63..654829e 100644 --- a/src/clientP2P/ClientP2P.java +++ b/src/clientP2P/ClientP2P.java @@ -47,7 +47,6 @@ public class ClientP2P { System.out.println("Server will listen on port " + port + " and serve files from " + directories.getDataHomeDirectory() + subdir); directories.askOpenDataHomeDirectory(subdir); System.out.println("Please enter list of servers to use; first one will be used to ask list of files"); - hostList = HostList.getServList(); } public static void main(String [] args) { @@ -67,6 +66,13 @@ public class ClientP2P { ttcp.setName("server TCP P2P-JAVA-PROJECT"); ttcp.start(); + try { + Thread.sleep(100); + } catch(InterruptedException e) { + Thread.currentThread().interrupt(); + } + + c.hostList = HostList.getServList(); System.out.println("Client : Which transport protocol do you want to use? [TCP/udp]"); Scanner sc = new Scanner(System.in); String transportchoosen = sc.nextLine();