Skip to content

Commit

Permalink
Document mosquitto_connect_srv().
Browse files Browse the repository at this point in the history
Closes #1499. Thanks to Basavesh Shivakumar.
  • Loading branch information
ralight committed Nov 22, 2019
1 parent fc23889 commit c37251c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions ChangeLog.txt
Expand Up @@ -20,6 +20,7 @@ Client library:
- Fix publish properties not being passed to on_message_v5 callback for QoS 2
messages. Closes #1432.
- Fix documentation issues in mosquitto.h. Closes #1478.
- Document `mosquitto_connect_srv()`. Closes #1499.

Clients:
- Fix duplicate cfg definition in rr_client. Closes #1453.
Expand Down
16 changes: 7 additions & 9 deletions lib/mosquitto.h
Expand Up @@ -583,20 +583,18 @@ libmosq_EXPORT int mosquitto_connect_bind_async(struct mosquitto *mosq, const ch
/*
* Function: mosquitto_connect_srv
*
* Connect to an MQTT broker. This is a non-blocking call. If you use
* <mosquitto_connect_async> your client must use the threaded interface
* <mosquitto_loop_start>. If you need to use <mosquitto_loop>, you must use
* <mosquitto_connect> to connect the client.
* Connect to an MQTT broker.
*
* This extends the functionality of <mosquitto_connect_async> by adding the
* bind_address parameter. Use this function if you need to restrict network
* communication over a particular interface.
* If you set `host` to `example.com`, then this call will attempt to retrieve
* the DNS SRV record for `_secure-mqtt._tcp.example.com` or
* `_mqtt._tcp.example.com` to discover which actual host to connect to.
*
* May be called before or after <mosquitto_loop_start>.
* DNS SRV support is not usually compiled in to libmosquitto, use of this call
* is not recommended.
*
* Parameters:
* mosq - a valid mosquitto instance.
* host - the hostname or ip address of the broker to connect to.
* host - the hostname to search for an SRV record.
* keepalive - the number of seconds after which the broker should send a PING
* message to the client if no other messages have been exchanged
* in that time.
Expand Down

0 comments on commit c37251c

Please sign in to comment.