Skip to content

Commit

Permalink
Merge pull request #44 from nats-io/add_get_discovered_servers
Browse files Browse the repository at this point in the history
[ADDED] natsConnection_GetDiscoveredServers API
  • Loading branch information
kozlovic authored Nov 3, 2016
2 parents 4edf042 + e0208d0 commit e197c46
Show file tree
Hide file tree
Showing 18 changed files with 228 additions and 61 deletions.
3 changes: 3 additions & 0 deletions doc/html/globals.html
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ <h3><a class="anchor" id="index_n"></a>- n -</h3><ul>
<li>natsConnection_GetConnectedUrl()
: <a class="el" href="group__conn_mgt_group.html#gaf623280407c43ade02285005f0642e6d">nats.h</a>
</li>
<li>natsConnection_GetDiscoveredServers()
: <a class="el" href="group__conn_mgt_group.html#gad25c77be0873495412c90a73fe450708">nats.h</a>
</li>
<li>natsConnection_GetLastError()
: <a class="el" href="group__conn_mgt_group.html#gab6cfa9cb6857ae10f096a94f5e244e63">nats.h</a>
</li>
Expand Down
3 changes: 3 additions & 0 deletions doc/html/globals_func.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ <h3><a class="anchor" id="index_n"></a>- n -</h3><ul>
<li>natsConnection_GetConnectedUrl()
: <a class="el" href="group__conn_mgt_group.html#gaf623280407c43ade02285005f0642e6d">nats.h</a>
</li>
<li>natsConnection_GetDiscoveredServers()
: <a class="el" href="group__conn_mgt_group.html#gad25c77be0873495412c90a73fe450708">nats.h</a>
</li>
<li>natsConnection_GetLastError()
: <a class="el" href="group__conn_mgt_group.html#gab6cfa9cb6857ae10f096a94f5e244e63">nats.h</a>
</li>
Expand Down
47 changes: 47 additions & 0 deletions doc/html/group__conn_mgt_group.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@
<tr class="memitem:gaf4ee7262e35e44c40ad5dfe9240db76b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__conn_mgt_group.html#gaf4ee7262e35e44c40ad5dfe9240db76b">natsConnection_GetServers</a> (<a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec">natsConnection</a> *nc, char ***servers, int *count)</td></tr>
<tr class="memdesc:gaf4ee7262e35e44c40ad5dfe9240db76b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the list of server URLs known to this connection. <a href="#gaf4ee7262e35e44c40ad5dfe9240db76b">More...</a><br /></td></tr>
<tr class="separator:gaf4ee7262e35e44c40ad5dfe9240db76b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad25c77be0873495412c90a73fe450708"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__conn_mgt_group.html#gad25c77be0873495412c90a73fe450708">natsConnection_GetDiscoveredServers</a> (<a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec">natsConnection</a> *nc, char ***servers, int *count)</td></tr>
<tr class="memdesc:gad25c77be0873495412c90a73fe450708"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the list of discovered server URLs. <a href="#gad25c77be0873495412c90a73fe450708">More...</a><br /></td></tr>
<tr class="separator:gad25c77be0873495412c90a73fe450708"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab6cfa9cb6857ae10f096a94f5e244e63"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__conn_mgt_group.html#gab6cfa9cb6857ae10f096a94f5e244e63">natsConnection_GetLastError</a> (<a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec">natsConnection</a> *nc, const char **lastError)</td></tr>
<tr class="memdesc:gab6cfa9cb6857ae10f096a94f5e244e63"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the last connection error. <a href="#gab6cfa9cb6857ae10f096a94f5e244e63">More...</a><br /></td></tr>
<tr class="separator:gab6cfa9cb6857ae10f096a94f5e244e63"><td class="memSeparator" colspan="2">&#160;</td></tr>
Expand Down Expand Up @@ -627,6 +630,50 @@ <h2 class="groupheader">Function Documentation</h2>
</dd>
</dl>

</div>
</div>
<a class="anchor" id="gad25c77be0873495412c90a73fe450708"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> natsConnection_GetDiscoveredServers </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec">natsConnection</a> *&#160;</td>
<td class="paramname"><em>nc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char ***&#160;</td>
<td class="paramname"><em>servers</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&#160;</td>
<td class="paramname"><em>count</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Unlike <a class="el" href="group__conn_mgt_group.html#gaf4ee7262e35e44c40ad5dfe9240db76b" title="Returns the list of server URLs known to this connection. ">natsConnection_GetServers</a>, this function only returns the list of servers that have been discovered after the a connection has been established (with servers version 0.9.2 and above).</p>
<p>No credential information is included in any of the server URLs returned by this call.<br />
If you want to use any of these URLs to connect to a server that requires authentication, you will need to use <a class="el" href="group__opts_group.html#ga5b99da7dd74aac3be962f323c3863d9e" title="Sets the user name/password to use when not specified in the URL. ">natsOptions_SetUserInfo</a> or <a class="el" href="group__opts_group.html#gad58a5b9dabadeebda30e952ff7b39193" title="Sets the token to use when not specified in the URL. ">natsOptions_SetToken</a>.</p>
<dl class="section note"><dt>Note</dt><dd>The user is responsible for freeing the memory of the returned array.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">nc</td><td>the pointer to the <a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec" title="A connection to a NATS Server. ">natsConnection</a> object. </td></tr>
<tr><td class="paramname">servers</td><td>the location where to store the pointer to the array of server URLs. </td></tr>
<tr><td class="paramname">count</td><td>the location where to store the number of elements of the returned array. </td></tr>
</table>
</dd>
</dl>

</div>
</div>
<a class="anchor" id="gab6cfa9cb6857ae10f096a94f5e244e63"></a>
Expand Down
1 change: 1 addition & 0 deletions doc/html/group__conn_mgt_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var group__conn_mgt_group =
[ "natsConnection_GetConnectedUrl", "group__conn_mgt_group.html#gaf623280407c43ade02285005f0642e6d", null ],
[ "natsConnection_GetConnectedServerId", "group__conn_mgt_group.html#ga48cee9ea1cdc9fc2770de2f9f0fd1ccf", null ],
[ "natsConnection_GetServers", "group__conn_mgt_group.html#gaf4ee7262e35e44c40ad5dfe9240db76b", null ],
[ "natsConnection_GetDiscoveredServers", "group__conn_mgt_group.html#gad25c77be0873495412c90a73fe450708", null ],
[ "natsConnection_GetLastError", "group__conn_mgt_group.html#gab6cfa9cb6857ae10f096a94f5e244e63", null ],
[ "natsConnection_Close", "group__conn_mgt_group.html#ga19e204d27a232e2d4334301fc002b2ed", null ],
[ "natsConnection_Destroy", "group__conn_mgt_group.html#gafda2f702276fb0ac301efac10df09495", null ]
Expand Down
3 changes: 3 additions & 0 deletions doc/html/nats_8h.html
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@
<tr class="memitem:gaf4ee7262e35e44c40ad5dfe9240db76b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__conn_mgt_group.html#gaf4ee7262e35e44c40ad5dfe9240db76b">natsConnection_GetServers</a> (<a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec">natsConnection</a> *nc, char ***servers, int *count)</td></tr>
<tr class="memdesc:gaf4ee7262e35e44c40ad5dfe9240db76b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the list of server URLs known to this connection. <a href="group__conn_mgt_group.html#gaf4ee7262e35e44c40ad5dfe9240db76b">More...</a><br /></td></tr>
<tr class="separator:gaf4ee7262e35e44c40ad5dfe9240db76b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad25c77be0873495412c90a73fe450708"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__conn_mgt_group.html#gad25c77be0873495412c90a73fe450708">natsConnection_GetDiscoveredServers</a> (<a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec">natsConnection</a> *nc, char ***servers, int *count)</td></tr>
<tr class="memdesc:gad25c77be0873495412c90a73fe450708"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the list of discovered server URLs. <a href="group__conn_mgt_group.html#gad25c77be0873495412c90a73fe450708">More...</a><br /></td></tr>
<tr class="separator:gad25c77be0873495412c90a73fe450708"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab6cfa9cb6857ae10f096a94f5e244e63"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__conn_mgt_group.html#gab6cfa9cb6857ae10f096a94f5e244e63">natsConnection_GetLastError</a> (<a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec">natsConnection</a> *nc, const char **lastError)</td></tr>
<tr class="memdesc:gab6cfa9cb6857ae10f096a94f5e244e63"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the last connection error. <a href="group__conn_mgt_group.html#gab6cfa9cb6857ae10f096a94f5e244e63">More...</a><br /></td></tr>
<tr class="separator:gab6cfa9cb6857ae10f096a94f5e244e63"><td class="memSeparator" colspan="2">&#160;</td></tr>
Expand Down
1 change: 1 addition & 0 deletions doc/html/nats_8h.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ var nats_8h =
[ "natsConnection_GetConnectedUrl", "group__conn_mgt_group.html#gaf623280407c43ade02285005f0642e6d", null ],
[ "natsConnection_GetConnectedServerId", "group__conn_mgt_group.html#ga48cee9ea1cdc9fc2770de2f9f0fd1ccf", null ],
[ "natsConnection_GetServers", "group__conn_mgt_group.html#gaf4ee7262e35e44c40ad5dfe9240db76b", null ],
[ "natsConnection_GetDiscoveredServers", "group__conn_mgt_group.html#gad25c77be0873495412c90a73fe450708", null ],
[ "natsConnection_GetLastError", "group__conn_mgt_group.html#gab6cfa9cb6857ae10f096a94f5e244e63", null ],
[ "natsConnection_Close", "group__conn_mgt_group.html#ga19e204d27a232e2d4334301fc002b2ed", null ],
[ "natsConnection_Destroy", "group__conn_mgt_group.html#gafda2f702276fb0ac301efac10df09495", null ],
Expand Down
3 changes: 2 additions & 1 deletion doc/html/nats_8h_source.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/html/navtreedata.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var NAVTREE =
var NAVTREEINDEX =
[
"deprecated.html",
"group__sub_group.html#ga786bb458981274fe717f266bd3b96d96"
"group__sub_group.html#ga68a7cea89e75c529a7dd3bb77303dda4"
];

var SYNCONMSG = 'click to disable panel synchronisation';
Expand Down
Loading

0 comments on commit e197c46

Please sign in to comment.