Set max trying number for input peers
Write output message to log file
Allow setting listening port from command line