-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathServer.java
More file actions
28 lines (25 loc) · 794 Bytes
/
Copy pathServer.java
File metadata and controls
28 lines (25 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
/**
* Project 5 - Server.java
*
* Class that handles server host and port connection and thread allocation.
*
* @author Shafer Anthony Hofmann, Qihang Gan, Shreyas Viswanathan, Nathan Pasic
* Miller, Oliver Long
*
* @version December 7, 2023
*/
public class Server {
public static final int PORT_NUMBER = 4242;
public static void main(String[] args) throws IOException, ClassNotFoundException {
try (ServerSocket serverSocket = new ServerSocket(PORT_NUMBER)) {
while (true) {
Socket socket = serverSocket.accept();
ServerThread serverThread = new ServerThread(socket);
serverThread.start();
}
}
}
}