public static void main(String[] args)
    {
        VideoPlayer player = new VideoPlayer();
   		ServerSocket server = null;
    	int port = getPort(args);

    	try
    	{
    		server = new ServerSocket(port);
    	}
    	catch(SecurityException e)
    	{
    		System.out.println("It appears you cannot use the port: "+port);
    		System.out.println("Please rerun the application with a new port as the argument.");
    		System.out.println("Example: -d <port>");
    		System.exit(1);
    	}
    	catch(IOException e)
    	{
    		System.out.println("Error connecting to the port "+port+", maybe something else is using it?");
    		System.exit(1);
    	}
    	catch(IllegalArgumentException e)
    	{
    		System.out.println("Out of port range! The range is between 0 and 65535");
    		System.exit(1);
    	}
    	while(true)
    	{
    		try
    		{
    			Thread connection = new Thread(new ClientConnection(server.accept(), player));
                connection.start();
    		}
            catch(IOException e)
            {
                System.out.println("Error with connection");
            }
    	}
    }