Closed fbritop closed 11 months ago
I would guess you can put in into constructor
Client::Client(const char * host, uint16_t port, const char * id, const char * user, const char * password, unsigned long reconnect_interval_millis)
Therefore
PicoMQTT::Client mqtt("broker.hivemq.com", 12345);
@dasflaigsi is correct, the client's constructor allows specifying optional parameters. The 2nd parameter is the port number. It defaults to 1883.
Here's the constructor declaration: https://github.com/mlesniew/PicoMQTT/blob/master/src/PicoMQTT/client.h#L46
Can't find a way to do the same for a Server ? Is there any way to set a custom port for a MQTT Server ?
Looks like the Server didn't have a constructor that would allow this. It's fixed in v0.3.4, now you can do:
PicoMQTT::Server mqtt(1234 /* custom port */);
Is it possible to setup the port manually? I cannot find any public method to it