-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
23 lines (18 loc) · 703 Bytes
/
Copy pathMain.java
File metadata and controls
23 lines (18 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.io.IOException;
import java.util.InputMismatchException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(System.in);
try {
System.out.println("Please enter the port number to run the server: ");
int port = in.nextInt();
System.out.println("Please enter the filename to store the logs:");
String file = in.next();
new UDPServer(port, file).start();
} catch (InputMismatchException e) {
System.out.println("Invalid input entered, please enter a valid port number.");
}
in.close();
}
}