public static void main(String [] args) throws SocketException, NoSuchAlgorithmException {
        if(args.length < 2) {
            System.out.println("Invalid number of arguments to start server. Needs <port> <shared secret>");
            return;
        }
        try {
            UDPServer server = new UDPServer(Integer.parseInt(args[0]), args[1]);

            while(server.isRunning) {
                byte[] receiveData = new byte[4096];

                DatagramPacket packet = new DatagramPacket(receiveData, receiveData.length);
                server.socket.receive(packet);

                Runnable worker = new UDPServerThread(server.socket, packet, server.sharedSecret);
                server.service.execute(worker);
            }
        } catch (SocketException ex) {
            System.out.println("Socket could not be bound to port " + args[0] + " please try again with another port.");
            ex.printStackTrace();
        } catch (IOException ex) {
            System.out.println("Package could not be received.");
            ex.printStackTrace();
        }
    }