Shouldn't the third %s be a %d as it's the port number? (Here and further on too)