COMP2396
Loading...
Searching...
No Matches
T8Server.java
Go to the documentation of this file.
1import java.io.IOException;
2import java.net.ServerSocket;
3import java.util.concurrent.Executors;
4
5public class T8Server {
6
7 public static void main(String[] args) throws IOException {
8 System.out.println("Server is Running...");
9 Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
10 public void run() {
11 System.out.println("Server Stopped.");
12 }
13 }));
14
15 try (var listener = new ServerSocket(58901)) {
16 Server myServer = new Server(listener);
17 myServer.start();
18 } catch (Exception e) {
19 System.out.println(e.getMessage());
20 }
21 }
22
23}
void start()
Definition Server.java:22
static void main(String[] args)
Definition T8Server.java:7