Get MQTT port from commandline arg

This code directly comes from MQTT library.
Im wondering weather we should refactor these code for code qualitity