public static void main(String[] args) throws IOException, InterruptedException {
		System.out.println("Started pxchat server...");
		
		if (args.length > 0) {
			configFilename = args[0];
		}

		if (!loadConfig())
			return;

		System.out.println("Listening on Port " + port);

		Runtime.getRuntime().addShutdownHook(new Thread() {
			public void run() {
				server.close();
				udpServer.interrupt();
				try {
					System.out.println("Delete entry from server list");
					new URL(serverList + "?action=del&p = defaultPortort=" + port).openStream();
				} catch (Exception e) {
					System.out.println("Could not contact master server");
				}
			}
		});
		
		server = new Server();
		server.setAuthList(authList);
		server.listen(port);
		
		Signal reloadSignal = new Signal("USR2");
		ServerMain instance = new ServerMain();
		Signal.handle(reloadSignal, instance);
		
		udpServer.start();
		
		int count = 0;
		while (true) {
			if (count % 6 == 0) {
				updateServerList(name);
				count = 0;
			}
			System.out.println("Connected users: " + server.getUserList());
			count++;
			Thread.sleep(10000);
		}
	}