public void listen(int port) {
		try {
			server = new ServerSocket(port);
			listening = true;
			while (listening) {
				new TCPClient(server.accept()).start();
			}
		} catch (Exception ex) {
			if (!ex.getMessage().equals("socket closed") && !server.isClosed())
				ex.printStackTrace();
		}
	}