use popt to check command line arguments, add debug message to see what port is being listened to.