-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
38 lines (31 loc) · 1.09 KB
/
Main.java
File metadata and controls
38 lines (31 loc) · 1.09 KB
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
29
30
31
32
33
34
35
36
37
38
package Server;
import Server.Services.Control;
import Server.Services.Reverse;
import Server.interfaces.Service;
import java.io.IOException;
import java.util.logging.Logger;
/**
*
* @author Nhahn
*/
public class Main {
private final static Logger LOGGER = Logger.getLogger(Main.class.getName());
public static void main(String[] args) {
try {
LoggerConfig.setup();
LOGGER.info("Init Application");
// Create a Server object that uses standard out as its log and
// has a limit of ten concurrent connections at once.
Server s = new Server(10);
// Parse the argument list
s.addService(new Control(s, "1234"), 27000);
s.addService((Service) new Reverse(), 23000);
} catch (IOException e) { // Display a message if anything goes wrong
System.err.println("Server: " + e);
System.err.println("Usage: java Server "
+ "[-control <password> <port>] "
+ "[<servicename> <port> ... ]");
System.exit(1);
}
}
}