Loading src/Main.java +83 −77 Original line number Diff line number Diff line import java.io.*; import java.net.*; package edu.bu.ec504.project; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.net.ConnectException; import java.net.ServerSocket; import java.net.Socket; public class Main { /** * Method to run the client side of the program * * @param clientSocket * @param argument * @throws IOException Loading Loading @@ -77,8 +84,7 @@ public class Main { try (Socket clientSocket = new Socket("localhost", PORT_NUMBER)) { // If a client connection is successful, run the client side of the program runClient(clientSocket, filename); } catch (ConnectException e) { } catch (ConnectException e) { // If a client connection fails, run the server side of the program ServerSocket serverSocket = new ServerSocket(PORT_NUMBER); serverSocket.setSoTimeout(60 * 1000); Loading Loading
src/Main.java +83 −77 Original line number Diff line number Diff line import java.io.*; import java.net.*; package edu.bu.ec504.project; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.net.ConnectException; import java.net.ServerSocket; import java.net.Socket; public class Main { /** * Method to run the client side of the program * * @param clientSocket * @param argument * @throws IOException Loading Loading @@ -77,8 +84,7 @@ public class Main { try (Socket clientSocket = new Socket("localhost", PORT_NUMBER)) { // If a client connection is successful, run the client side of the program runClient(clientSocket, filename); } catch (ConnectException e) { } catch (ConnectException e) { // If a client connection fails, run the server side of the program ServerSocket serverSocket = new ServerSocket(PORT_NUMBER); serverSocket.setSoTimeout(60 * 1000); Loading