Skip to content

Conversation

@waymirec
Copy link

Added the ability to specify a list of of host and port tuples of brokers to connect to. Each host in the list will be attempted before the reconnect strategy is engaged.

Also added an "is_connected" api function that returns false if not connected and {true, {Host, Port}} when connected.

Populating the "hosts" config option with a list of {Host, Tuple} pairs
will cause emqttc to attempt to connect to each host in the list
before initiating the reconnect strategy.
If not a response of false is returned.
If it is connected a response of {true, {Host, Port}} is returned.
…er during init.

That way the connect function does not need to check whether hosts is empty but can
simply pull hosts out of it for connecting. It is guaranteed to always have at least
one entry because if it is not explicitly defined then it have the "host" and "port"
state members added to it which will always be defined.
@emqplus emqplus self-requested a review November 20, 2017 03:11
@emqplus emqplus added this to the 2.0 milestone Nov 20, 2017
@HJianBo HJianBo assigned tigercl and unassigned HJianBo Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants