nats.zig/deps/nats.c/doc/html/group__opts_group.html

2595 lines
190 KiB
HTML
Raw Normal View History

<!-- HTML header for doxygen 1.8.10-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<title>NATS C Client with JetStream and Streaming support: Options</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="customdoxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;" >
<div id="projectname">NATS C Client with JetStream and Streaming support
&#160;<span id="projectnumber">3.7.0</span>
</div>
<div id="projectbrief">The nats.io C Client, Supported by Synadia Communications Inc.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__opts_group.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">Options<div class="ingroups"><a class="el" href="group__func_group.html">Functions</a></div></div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga61d4a0cf2fbf7d13cc910e5a00c575be" id="r_ga61d4a0cf2fbf7d13cc910e5a00c575be"><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__opts_group.html#ga61d4a0cf2fbf7d13cc910e5a00c575be">natsOptions_Create</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> **newOpts)</td></tr>
<tr class="memdesc:ga61d4a0cf2fbf7d13cc910e5a00c575be"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. <br /></td></tr>
<tr class="separator:ga61d4a0cf2fbf7d13cc910e5a00c575be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3f7e760214417c7d87541ecb9ab5bea5" id="r_ga3f7e760214417c7d87541ecb9ab5bea5"><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__opts_group.html#ga3f7e760214417c7d87541ecb9ab5bea5">natsOptions_SetURL</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, const char *url)</td></tr>
<tr class="memdesc:ga3f7e760214417c7d87541ecb9ab5bea5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the URL to connect to. <br /></td></tr>
<tr class="separator:ga3f7e760214417c7d87541ecb9ab5bea5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacb7e964ae54b74d972d72e118b7b8bdf" id="r_gacb7e964ae54b74d972d72e118b7b8bdf"><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__opts_group.html#gacb7e964ae54b74d972d72e118b7b8bdf">natsOptions_SetServers</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, const char **servers, int serversCount)</td></tr>
<tr class="memdesc:gacb7e964ae54b74d972d72e118b7b8bdf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the list of servers to try to (re)connect to. <br /></td></tr>
<tr class="separator:gacb7e964ae54b74d972d72e118b7b8bdf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5b99da7dd74aac3be962f323c3863d9e" id="r_ga5b99da7dd74aac3be962f323c3863d9e"><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__opts_group.html#ga5b99da7dd74aac3be962f323c3863d9e">natsOptions_SetUserInfo</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, const char *user, const char *password)</td></tr>
<tr class="memdesc:ga5b99da7dd74aac3be962f323c3863d9e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the user name/password to use when not specified in the URL. <br /></td></tr>
<tr class="separator:ga5b99da7dd74aac3be962f323c3863d9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad58a5b9dabadeebda30e952ff7b39193" id="r_gad58a5b9dabadeebda30e952ff7b39193"><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__opts_group.html#gad58a5b9dabadeebda30e952ff7b39193">natsOptions_SetToken</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, const char *token)</td></tr>
<tr class="memdesc:gad58a5b9dabadeebda30e952ff7b39193"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the token to use when not specified in the URL. <br /></td></tr>
<tr class="separator:gad58a5b9dabadeebda30e952ff7b39193"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga23a3b1f022112e98ddccb18b247b4426" id="r_ga23a3b1f022112e98ddccb18b247b4426"><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__opts_group.html#ga23a3b1f022112e98ddccb18b247b4426">natsOptions_SetTokenHandler</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, <a class="el" href="group__callbacks_group.html#ga4b02de70fe9380d184fd01d87527f499">natsTokenHandler</a> tokenCb, void *closure)</td></tr>
<tr class="memdesc:ga23a3b1f022112e98ddccb18b247b4426"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the tokenCb to use whenever a token is needed. <br /></td></tr>
<tr class="separator:ga23a3b1f022112e98ddccb18b247b4426"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaabf8763b931dcf389c83fd95d760a413" id="r_gaabf8763b931dcf389c83fd95d760a413"><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__opts_group.html#gaabf8763b931dcf389c83fd95d760a413">natsOptions_SetNoRandomize</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, bool noRandomize)</td></tr>
<tr class="memdesc:gaabf8763b931dcf389c83fd95d760a413"><td class="mdescLeft">&#160;</td><td class="mdescRight">Indicate if the servers list should be randomized. <br /></td></tr>
<tr class="separator:gaabf8763b931dcf389c83fd95d760a413"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga17cd7fe41176cd98aca1184fa9352ad9" id="r_ga17cd7fe41176cd98aca1184fa9352ad9"><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__opts_group.html#ga17cd7fe41176cd98aca1184fa9352ad9">natsOptions_SetTimeout</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, int64_t timeout)</td></tr>
<tr class="memdesc:ga17cd7fe41176cd98aca1184fa9352ad9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the (re)connect process timeout. <br /></td></tr>
<tr class="separator:ga17cd7fe41176cd98aca1184fa9352ad9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1c529d347be0fe2eec17c7f4698e283e" id="r_ga1c529d347be0fe2eec17c7f4698e283e"><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__opts_group.html#ga1c529d347be0fe2eec17c7f4698e283e">natsOptions_SetName</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, const char *name)</td></tr>
<tr class="memdesc:ga1c529d347be0fe2eec17c7f4698e283e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the name. <br /></td></tr>
<tr class="separator:ga1c529d347be0fe2eec17c7f4698e283e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa1f09416d443fa7a6af6b695da563eba" id="r_gaa1f09416d443fa7a6af6b695da563eba"><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__opts_group.html#gaa1f09416d443fa7a6af6b695da563eba">natsOptions_SetSecure</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, bool secure)</td></tr>
<tr class="memdesc:gaa1f09416d443fa7a6af6b695da563eba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the secure mode. <br /></td></tr>
<tr class="separator:gaa1f09416d443fa7a6af6b695da563eba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2cd6563694a439b3949a31fd81103099" id="r_ga2cd6563694a439b3949a31fd81103099"><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__opts_group.html#ga2cd6563694a439b3949a31fd81103099">natsOptions_LoadCATrustedCertificates</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, const char *fileName)</td></tr>
<tr class="memdesc:ga2cd6563694a439b3949a31fd81103099"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loads the trusted CA certificates from a file. <br /></td></tr>
<tr class="separator:ga2cd6563694a439b3949a31fd81103099"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafb30794fc2ae74b9e0bd8fb609b901c8" id="r_gafb30794fc2ae74b9e0bd8fb609b901c8"><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__opts_group.html#gafb30794fc2ae74b9e0bd8fb609b901c8">natsOptions_SetCATrustedCertificates</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, const char *certificates)</td></tr>
<tr class="memdesc:gafb30794fc2ae74b9e0bd8fb609b901c8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the trusted CA certificates from memory. <br /></td></tr>
<tr class="separator:gafb30794fc2ae74b9e0bd8fb609b901c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga36943e2ba53d05407cdabc4e7e96484b" id="r_ga36943e2ba53d05407cdabc4e7e96484b"><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__opts_group.html#ga36943e2ba53d05407cdabc4e7e96484b">natsOptions_LoadCertificatesChain</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, const char *certsFileName, const char *keyFileName)</td></tr>
<tr class="memdesc:ga36943e2ba53d05407cdabc4e7e96484b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loads the certificate chain from a file, using the given key. <br /></td></tr>
<tr class="separator:ga36943e2ba53d05407cdabc4e7e96484b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae98f0f9034e93941767ab1ae6eec2c0c" id="r_gae98f0f9034e93941767ab1ae6eec2c0c"><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__opts_group.html#gae98f0f9034e93941767ab1ae6eec2c0c">natsOptions_SetCertificatesChain</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, const char *cert, const char *key)</td></tr>
<tr class="memdesc:gae98f0f9034e93941767ab1ae6eec2c0c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the client certificate and key. <br /></td></tr>
<tr class="separator:gae98f0f9034e93941767ab1ae6eec2c0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5698f020e8eb3e7440eb073fe08ef62c" id="r_ga5698f020e8eb3e7440eb073fe08ef62c"><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__opts_group.html#ga5698f020e8eb3e7440eb073fe08ef62c">natsOptions_SetCiphers</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, const char *ciphers)</td></tr>
<tr class="memdesc:ga5698f020e8eb3e7440eb073fe08ef62c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the list of available ciphers. <br /></td></tr>
<tr class="separator:ga5698f020e8eb3e7440eb073fe08ef62c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2b7f144b011d8ce62941b608a8f324f0" id="r_ga2b7f144b011d8ce62941b608a8f324f0"><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__opts_group.html#ga2b7f144b011d8ce62941b608a8f324f0">natsOptions_SetCipherSuites</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, const char *ciphers)</td></tr>
<tr class="memdesc:ga2b7f144b011d8ce62941b608a8f324f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the list of available ciphers for TLSv1.3. <br /></td></tr>
<tr class="separator:ga2b7f144b011d8ce62941b608a8f324f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0ba43ba9930df385e4781b12be9f2851" id="r_ga0ba43ba9930df385e4781b12be9f2851"><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__opts_group.html#ga0ba43ba9930df385e4781b12be9f2851">natsOptions_SetExpectedHostname</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, const char *hostname)</td></tr>
<tr class="memdesc:ga0ba43ba9930df385e4781b12be9f2851"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the server certificate's expected hostname. <br /></td></tr>
<tr class="separator:ga0ba43ba9930df385e4781b12be9f2851"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6f804ec44adc299989fe623570679da3" id="r_ga6f804ec44adc299989fe623570679da3"><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__opts_group.html#ga6f804ec44adc299989fe623570679da3">natsOptions_SkipServerVerification</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, bool skip)</td></tr>
<tr class="memdesc:ga6f804ec44adc299989fe623570679da3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Switch server certificate verification. <br /></td></tr>
<tr class="separator:ga6f804ec44adc299989fe623570679da3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa16bfd09ef318af18c27a0e199681b69" id="r_gaa16bfd09ef318af18c27a0e199681b69"><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__opts_group.html#gaa16bfd09ef318af18c27a0e199681b69">natsOptions_SetVerbose</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, bool verbose)</td></tr>
<tr class="memdesc:gaa16bfd09ef318af18c27a0e199681b69"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the verbose mode. <br /></td></tr>
<tr class="separator:gaa16bfd09ef318af18c27a0e199681b69"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga26f166af20de98bec67bc6cc916f769e" id="r_ga26f166af20de98bec67bc6cc916f769e"><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__opts_group.html#ga26f166af20de98bec67bc6cc916f769e">natsOptions_SetPedantic</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, bool pedantic)</td></tr>
<tr class="memdesc:ga26f166af20de98bec67bc6cc916f769e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the pedantic mode. <br /></td></tr>
<tr class="separator:ga26f166af20de98bec67bc6cc916f769e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae68fb615835364c0809555e8dc93f57e" id="r_gae68fb615835364c0809555e8dc93f57e"><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__opts_group.html#gae68fb615835364c0809555e8dc93f57e">natsOptions_SetPingInterval</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, int64_t interval)</td></tr>
<tr class="memdesc:gae68fb615835364c0809555e8dc93f57e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the ping interval. <br /></td></tr>
<tr class="separator:gae68fb615835364c0809555e8dc93f57e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaff89c3f41627f4b2929dbc9b82d265b" id="r_gaaff89c3f41627f4b2929dbc9b82d265b"><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__opts_group.html#gaaff89c3f41627f4b2929dbc9b82d265b">natsOptions_SetMaxPingsOut</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, int maxPingsOut)</td></tr>
<tr class="memdesc:gaaff89c3f41627f4b2929dbc9b82d265b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the limit of outstanding <code>PING</code>s without corresponding <code>PONG</code>s. <br /></td></tr>
<tr class="separator:gaaff89c3f41627f4b2929dbc9b82d265b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1a3e3abfd7ddd8aff247df8f332bbda3" id="r_ga1a3e3abfd7ddd8aff247df8f332bbda3"><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__opts_group.html#ga1a3e3abfd7ddd8aff247df8f332bbda3">natsOptions_SetIOBufSize</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, int ioBufSize)</td></tr>
<tr class="memdesc:ga1a3e3abfd7ddd8aff247df8f332bbda3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the size of the internal read/write buffers. <br /></td></tr>
<tr class="separator:ga1a3e3abfd7ddd8aff247df8f332bbda3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3d1d3cb2f2a0e23d27dd60e96d1cc91b" id="r_ga3d1d3cb2f2a0e23d27dd60e96d1cc91b"><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__opts_group.html#ga3d1d3cb2f2a0e23d27dd60e96d1cc91b">natsOptions_SetAllowReconnect</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, bool allow)</td></tr>
<tr class="memdesc:ga3d1d3cb2f2a0e23d27dd60e96d1cc91b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Indicates if the connection will be allowed to reconnect. <br /></td></tr>
<tr class="separator:ga3d1d3cb2f2a0e23d27dd60e96d1cc91b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab54cd2719c0b64eebd6c7b83dd2908a0" id="r_gab54cd2719c0b64eebd6c7b83dd2908a0"><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__opts_group.html#gab54cd2719c0b64eebd6c7b83dd2908a0">natsOptions_SetMaxReconnect</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, int maxReconnect)</td></tr>
<tr class="memdesc:gab54cd2719c0b64eebd6c7b83dd2908a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the maximum number of reconnect attempts. <br /></td></tr>
<tr class="separator:gab54cd2719c0b64eebd6c7b83dd2908a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2730f4e16e318a2ef8de98dbf6ede807" id="r_ga2730f4e16e318a2ef8de98dbf6ede807"><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__opts_group.html#ga2730f4e16e318a2ef8de98dbf6ede807">natsOptions_SetReconnectWait</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, int64_t reconnectWait)</td></tr>
<tr class="memdesc:ga2730f4e16e318a2ef8de98dbf6ede807"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the time between reconnect attempts. <br /></td></tr>
<tr class="separator:ga2730f4e16e318a2ef8de98dbf6ede807"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8f3df57ed8ae418d3ae6678ae5e2a5d2" id="r_ga8f3df57ed8ae418d3ae6678ae5e2a5d2"><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__opts_group.html#ga8f3df57ed8ae418d3ae6678ae5e2a5d2">natsOptions_SetReconnectJitter</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, int64_t jitter, int64_t jitterTLS)</td></tr>
<tr class="memdesc:ga8f3df57ed8ae418d3ae6678ae5e2a5d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the upper bound of a random delay added to reconnect wait. <br /></td></tr>
<tr class="separator:ga8f3df57ed8ae418d3ae6678ae5e2a5d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3593165aa113d6736e0226ddc56b3e9d" id="r_ga3593165aa113d6736e0226ddc56b3e9d"><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__opts_group.html#ga3593165aa113d6736e0226ddc56b3e9d">natsOptions_SetCustomReconnectDelay</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, <a class="el" href="group__callbacks_group.html#ga3353d4b92851c52121f65aaf0684cba4">natsCustomReconnectDelayHandler</a> cb, void *closure)</td></tr>
<tr class="memdesc:ga3593165aa113d6736e0226ddc56b3e9d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the handler to invoke when the library needs to wait before the next reconnect attempts. <br /></td></tr>
<tr class="separator:ga3593165aa113d6736e0226ddc56b3e9d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa0d4b7ece8477cb9879f0dafff3456a5" id="r_gaa0d4b7ece8477cb9879f0dafff3456a5"><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__opts_group.html#gaa0d4b7ece8477cb9879f0dafff3456a5">natsOptions_SetReconnectBufSize</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, int reconnectBufSize)</td></tr>
<tr class="memdesc:gaa0d4b7ece8477cb9879f0dafff3456a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the size of the backing buffer used during reconnect. <br /></td></tr>
<tr class="separator:gaa0d4b7ece8477cb9879f0dafff3456a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga95510436eee06f9992ded96a44795c40" id="r_ga95510436eee06f9992ded96a44795c40"><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__opts_group.html#ga95510436eee06f9992ded96a44795c40">natsOptions_SetMaxPendingMsgs</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, int maxPending)</td></tr>
<tr class="memdesc:ga95510436eee06f9992ded96a44795c40"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the maximum number of pending messages per subscription. <br /></td></tr>
<tr class="separator:ga95510436eee06f9992ded96a44795c40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga127ec7a8196b453947a7fa9a64096cbd" id="r_ga127ec7a8196b453947a7fa9a64096cbd"><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__opts_group.html#ga127ec7a8196b453947a7fa9a64096cbd">natsOptions_SetErrorHandler</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, <a class="el" href="group__callbacks_group.html#ga9e511dffa471dfb971b7dd2b12329626">natsErrHandler</a> errHandler, void *closure)</td></tr>
<tr class="memdesc:ga127ec7a8196b453947a7fa9a64096cbd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the error handler for asynchronous events. <br /></td></tr>
<tr class="separator:ga127ec7a8196b453947a7fa9a64096cbd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga44410242e73134e5bb51ef27904a9253" id="r_ga44410242e73134e5bb51ef27904a9253"><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__opts_group.html#ga44410242e73134e5bb51ef27904a9253">natsOptions_SetClosedCB</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, <a class="el" href="group__callbacks_group.html#gacdef6aff3e47953f19e35857ab8e274c">natsConnectionHandler</a> closedCb, void *closure)</td></tr>
<tr class="memdesc:ga44410242e73134e5bb51ef27904a9253"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the callback to be invoked when a connection to a server is permanently lost. <br /></td></tr>
<tr class="separator:ga44410242e73134e5bb51ef27904a9253"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadc8dc0cedd91bda71d544f3dedc4a039" id="r_gadc8dc0cedd91bda71d544f3dedc4a039"><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__opts_group.html#gadc8dc0cedd91bda71d544f3dedc4a039">natsOptions_SetDisconnectedCB</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, <a class="el" href="group__callbacks_group.html#gacdef6aff3e47953f19e35857ab8e274c">natsConnectionHandler</a> disconnectedCb, void *closure)</td></tr>
<tr class="memdesc:gadc8dc0cedd91bda71d544f3dedc4a039"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the callback to be invoked when the connection to a server is lost. <br /></td></tr>
<tr class="separator:gadc8dc0cedd91bda71d544f3dedc4a039"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga26a48c8529fffa5f5d1a61c030979980" id="r_ga26a48c8529fffa5f5d1a61c030979980"><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__opts_group.html#ga26a48c8529fffa5f5d1a61c030979980">natsOptions_SetReconnectedCB</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, <a class="el" href="group__callbacks_group.html#gacdef6aff3e47953f19e35857ab8e274c">natsConnectionHandler</a> reconnectedCb, void *closure)</td></tr>
<tr class="memdesc:ga26a48c8529fffa5f5d1a61c030979980"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the callback to be invoked when the connection has reconnected. <br /></td></tr>
<tr class="separator:ga26a48c8529fffa5f5d1a61c030979980"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab5baab507c974402ab0d8c5e8227ee65" id="r_gab5baab507c974402ab0d8c5e8227ee65"><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__opts_group.html#gab5baab507c974402ab0d8c5e8227ee65">natsOptions_SetDiscoveredServersCB</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, <a class="el" href="group__callbacks_group.html#gacdef6aff3e47953f19e35857ab8e274c">natsConnectionHandler</a> discoveredServersCb, void *closure)</td></tr>
<tr class="memdesc:gab5baab507c974402ab0d8c5e8227ee65"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the callback to be invoked when new servers are discovered. <br /></td></tr>
<tr class="separator:gab5baab507c974402ab0d8c5e8227ee65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7e4172084520708b8c9f28e73174461c" id="r_ga7e4172084520708b8c9f28e73174461c"><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__opts_group.html#ga7e4172084520708b8c9f28e73174461c">natsOptions_SetIgnoreDiscoveredServers</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, bool ignore)</td></tr>
<tr class="memdesc:ga7e4172084520708b8c9f28e73174461c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets if the library should ignore or not discovered servers. <br /></td></tr>
<tr class="separator:ga7e4172084520708b8c9f28e73174461c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga54dea2ffeb33779771652a7a14fc4adc" id="r_ga54dea2ffeb33779771652a7a14fc4adc"><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__opts_group.html#ga54dea2ffeb33779771652a7a14fc4adc">natsOptions_SetLameDuckModeCB</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, <a class="el" href="group__callbacks_group.html#gacdef6aff3e47953f19e35857ab8e274c">natsConnectionHandler</a> lameDuckCb, void *closure)</td></tr>
<tr class="memdesc:ga54dea2ffeb33779771652a7a14fc4adc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the callback to be invoked when server enters lame duck mode. <br /></td></tr>
<tr class="separator:ga54dea2ffeb33779771652a7a14fc4adc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab09491bad908dedcb323c780280733ff" id="r_gab09491bad908dedcb323c780280733ff"><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__opts_group.html#gab09491bad908dedcb323c780280733ff">natsOptions_SetEventLoop</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, void *loop, <a class="el" href="group__callbacks_group.html#ga245eab0a01a485e40fba267f84ec037f">natsEvLoop_Attach</a> attachCb, <a class="el" href="group__callbacks_group.html#gaea4c125ecfb43eaf43da20e8444c2aaa">natsEvLoop_ReadAddRemove</a> readCb, <a class="el" href="group__callbacks_group.html#ga2bb5dd2d821ca5bbc0488f7e6aceed17">natsEvLoop_WriteAddRemove</a> writeCb, <a class="el" href="group__callbacks_group.html#gab63dee7f7012ba11ae20b76dbc36f2d0">natsEvLoop_Detach</a> detachCb)</td></tr>
<tr class="memdesc:gab09491bad908dedcb323c780280733ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the external event loop and associated callbacks. <br /></td></tr>
<tr class="separator:gab09491bad908dedcb323c780280733ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabf060c92648b50c069f0abe7cbb06f1c" id="r_gabf060c92648b50c069f0abe7cbb06f1c"><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__opts_group.html#gabf060c92648b50c069f0abe7cbb06f1c">natsOptions_UseGlobalMessageDelivery</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, bool global)</td></tr>
<tr class="memdesc:gabf060c92648b50c069f0abe7cbb06f1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Switch on/off the use of a central message delivery thread pool. <br /></td></tr>
<tr class="separator:gabf060c92648b50c069f0abe7cbb06f1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7ca713c7532eff4d41a492e95b8822cf" id="r_ga7ca713c7532eff4d41a492e95b8822cf"><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__opts_group.html#ga7ca713c7532eff4d41a492e95b8822cf">natsOptions_IPResolutionOrder</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, int order)</td></tr>
<tr class="memdesc:ga7ca713c7532eff4d41a492e95b8822cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Dictates the order in which host name are resolved during connect. <br /></td></tr>
<tr class="separator:ga7ca713c7532eff4d41a492e95b8822cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8f06568cc3319a5a0eef9f80282034ca" id="r_ga8f06568cc3319a5a0eef9f80282034ca"><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__opts_group.html#ga8f06568cc3319a5a0eef9f80282034ca">natsOptions_SetSendAsap</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, bool sendAsap)</td></tr>
<tr class="memdesc:ga8f06568cc3319a5a0eef9f80282034ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets if Publish calls should send data right away. <br /></td></tr>
<tr class="separator:ga8f06568cc3319a5a0eef9f80282034ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga70aa85319933d78c0076cc862fa3e5a6" id="r_ga70aa85319933d78c0076cc862fa3e5a6"><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__opts_group.html#ga70aa85319933d78c0076cc862fa3e5a6">natsOptions_UseOldRequestStyle</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, bool useOldStyle)</td></tr>
<tr class="memdesc:ga70aa85319933d78c0076cc862fa3e5a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Switches the use of old style requests. <br /></td></tr>
<tr class="separator:ga70aa85319933d78c0076cc862fa3e5a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadef4376a5e608cbc8c1a9e2b6335dc79" id="r_gadef4376a5e608cbc8c1a9e2b6335dc79"><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__opts_group.html#gadef4376a5e608cbc8c1a9e2b6335dc79">natsOptions_SetFailRequestsOnDisconnect</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, bool failRequests)</td></tr>
<tr class="memdesc:gadef4376a5e608cbc8c1a9e2b6335dc79"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fails pending requests on disconnect event. <br /></td></tr>
<tr class="separator:gadef4376a5e608cbc8c1a9e2b6335dc79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4f694b87039cedaa65cd25656b14d1a3" id="r_ga4f694b87039cedaa65cd25656b14d1a3"><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__opts_group.html#ga4f694b87039cedaa65cd25656b14d1a3">natsOptions_SetNoEcho</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, bool noEcho)</td></tr>
<tr class="memdesc:ga4f694b87039cedaa65cd25656b14d1a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets if connection receives its own messages. <br /></td></tr>
<tr class="separator:ga4f694b87039cedaa65cd25656b14d1a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga20946800d024b7089e73d63454d1c19f" id="r_ga20946800d024b7089e73d63454d1c19f"><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__opts_group.html#ga20946800d024b7089e73d63454d1c19f">natsOptions_SetRetryOnFailedConnect</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, bool retry, <a class="el" href="group__callbacks_group.html#gacdef6aff3e47953f19e35857ab8e274c">natsConnectionHandler</a> connectedCb, void *closure)</td></tr>
<tr class="memdesc:ga20946800d024b7089e73d63454d1c19f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Indicates if initial connect failure should be retried or not. <br /></td></tr>
<tr class="separator:ga20946800d024b7089e73d63454d1c19f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga60117450fc1f7b6f81bab455aeed7515" id="r_ga60117450fc1f7b6f81bab455aeed7515"><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__opts_group.html#ga60117450fc1f7b6f81bab455aeed7515">natsOptions_SetUserCredentialsCallbacks</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, <a class="el" href="group__callbacks_group.html#ga258b30458134be90f17315c037f34b7b">natsUserJWTHandler</a> ujwtCB, void *ujwtClosure, <a class="el" href="group__callbacks_group.html#gab786ffd670c86de0563559351305080b">natsSignatureHandler</a> sigCB, void *sigClosure)</td></tr>
<tr class="memdesc:ga60117450fc1f7b6f81bab455aeed7515"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the callbacks to fetch user JWT and sign server's nonce. <br /></td></tr>
<tr class="separator:ga60117450fc1f7b6f81bab455aeed7515"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga59b47f7b7a19085cf8eaada9bfe5606e" id="r_ga59b47f7b7a19085cf8eaada9bfe5606e"><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__opts_group.html#ga59b47f7b7a19085cf8eaada9bfe5606e">natsOptions_SetUserCredentialsFromFiles</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, const char *userOrChainedFile, const char *seedFile)</td></tr>
<tr class="memdesc:ga59b47f7b7a19085cf8eaada9bfe5606e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the file(s) to use to fetch user JWT and seed required to sign nonce. <br /></td></tr>
<tr class="separator:ga59b47f7b7a19085cf8eaada9bfe5606e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5d3d4d1269dd289f93c56b8a1ddccd43" id="r_ga5d3d4d1269dd289f93c56b8a1ddccd43"><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__opts_group.html#ga5d3d4d1269dd289f93c56b8a1ddccd43">natsOptions_SetUserCredentialsFromMemory</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, const char *jwtAndSeedContent)</td></tr>
<tr class="memdesc:ga5d3d4d1269dd289f93c56b8a1ddccd43"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets JWT handler and handler to sign nonce that uses seed. <br /></td></tr>
<tr class="separator:ga5d3d4d1269dd289f93c56b8a1ddccd43"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0290eac4665569c850468d9f00e246a0" id="r_ga0290eac4665569c850468d9f00e246a0"><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__opts_group.html#ga0290eac4665569c850468d9f00e246a0">natsOptions_SetNKey</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, const char *pubKey, <a class="el" href="group__callbacks_group.html#gab786ffd670c86de0563559351305080b">natsSignatureHandler</a> sigCB, void *sigClosure)</td></tr>
<tr class="memdesc:ga0290eac4665569c850468d9f00e246a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the NKey public key and signature callback. <br /></td></tr>
<tr class="separator:ga0290eac4665569c850468d9f00e246a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga696f02e0493c00d3c1eafff45b62b68e" id="r_ga696f02e0493c00d3c1eafff45b62b68e"><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__opts_group.html#ga696f02e0493c00d3c1eafff45b62b68e">natsOptions_SetNKeyFromSeed</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, const char *pubKey, const char *seedFile)</td></tr>
<tr class="memdesc:ga696f02e0493c00d3c1eafff45b62b68e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the NKey public key and its seed file. <br /></td></tr>
<tr class="separator:ga696f02e0493c00d3c1eafff45b62b68e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaafda5fb8d9ee3a17bd475ceaecfac218" id="r_gaafda5fb8d9ee3a17bd475ceaecfac218"><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__opts_group.html#gaafda5fb8d9ee3a17bd475ceaecfac218">natsOptions_SetWriteDeadline</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, int64_t deadline)</td></tr>
<tr class="memdesc:gaafda5fb8d9ee3a17bd475ceaecfac218"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the write deadline. <br /></td></tr>
<tr class="separator:gaafda5fb8d9ee3a17bd475ceaecfac218"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga192465163abb87ad48a843b45cdf9984" id="r_ga192465163abb87ad48a843b45cdf9984"><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__opts_group.html#ga192465163abb87ad48a843b45cdf9984">natsOptions_DisableNoResponders</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, bool disabled)</td></tr>
<tr class="memdesc:ga192465163abb87ad48a843b45cdf9984"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable/Disable the "no responders" feature. <br /></td></tr>
<tr class="separator:ga192465163abb87ad48a843b45cdf9984"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac5173473a731a4a36d15346fedddf91f" id="r_gac5173473a731a4a36d15346fedddf91f"><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__opts_group.html#gac5173473a731a4a36d15346fedddf91f">natsOptions_SetCustomInboxPrefix</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, const char *inboxPrefix)</td></tr>
<tr class="memdesc:gac5173473a731a4a36d15346fedddf91f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a custom inbox prefix. <br /></td></tr>
<tr class="separator:gac5173473a731a4a36d15346fedddf91f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5acd292cdaeb63d3d7bd9bbc05513c8f" id="r_ga5acd292cdaeb63d3d7bd9bbc05513c8f"><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__opts_group.html#ga5acd292cdaeb63d3d7bd9bbc05513c8f">natsOptions_SetMessageBufferPadding</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts, int paddingSize)</td></tr>
<tr class="memdesc:ga5acd292cdaeb63d3d7bd9bbc05513c8f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a custom padding when allocating buffer for incoming messages. <br /></td></tr>
<tr class="separator:ga5acd292cdaeb63d3d7bd9bbc05513c8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga93d8068cd6fff53b7f8e1c403db45eb9" id="r_ga93d8068cd6fff53b7f8e1c403db45eb9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opts_group.html#ga93d8068cd6fff53b7f8e1c403db45eb9">natsOptions_Destroy</a> (<a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *opts)</td></tr>
<tr class="memdesc:ga93d8068cd6fff53b7f8e1c403db45eb9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys a <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. <br /></td></tr>
<tr class="separator:ga93d8068cd6fff53b7f8e1c403db45eb9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>NATS Options. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga61d4a0cf2fbf7d13cc910e5a00c575be" name="ga61d4a0cf2fbf7d13cc910e5a00c575be"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga61d4a0cf2fbf7d13cc910e5a00c575be">&#9670;&#160;</a></span>natsOptions_Create()</h2>
<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> natsOptions_Create </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> **&#160;</td>
<td class="paramname"><em>newOpts</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. This object is used when one wants to set specific options prior to connecting to the <code>NATS Server</code>.</p>
<p>After making the appropriate natsOptions_Set calls, this object is passed to the <a class="el" href="group__conn_mgt_group.html#ga740be1ba16a8570eb98ef6755ebf52ce" title="Connects to a NATS Server using the provided options.">natsConnection_Connect()</a> call, which will clone this object. After <a class="el" href="group__conn_mgt_group.html#ga740be1ba16a8570eb98ef6755ebf52ce" title="Connects to a NATS Server using the provided options.">natsConnection_Connect()</a> returns, modifications to the options object will not affect the connection.</p>
<dl class="section note"><dt>Note</dt><dd>The object needs to be destroyed when no longer needed.*</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__conn_mgt_group.html#ga740be1ba16a8570eb98ef6755ebf52ce" title="Connects to a NATS Server using the provided options.">natsConnection_Connect()</a> </dd>
<dd>
<a class="el" href="group__opts_group.html#ga93d8068cd6fff53b7f8e1c403db45eb9" title="Destroys a natsOptions object.">natsOptions_Destroy()</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">newOpts</td><td>the location where store the pointer to the newly created <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga3f7e760214417c7d87541ecb9ab5bea5" name="ga3f7e760214417c7d87541ecb9ab5bea5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3f7e760214417c7d87541ecb9ab5bea5">&#9670;&#160;</a></span>natsOptions_SetURL()</h2>
<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> natsOptions_SetURL </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>url</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the URL of the <code>NATS Server</code> the client should try to connect to. The URL can contain optional user name and password.</p>
<p>Some valid URLS:</p>
<ul>
<li>nats://localhost:4222</li>
<li>nats://user@localhost:4222</li>
<li>nats://user:password@localhost:4222</li>
</ul>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__opts_group.html#gacb7e964ae54b74d972d72e118b7b8bdf" title="Set the list of servers to try to (re)connect to.">natsOptions_SetServers</a> </dd>
<dd>
<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> </dd>
<dd>
<a class="el" href="group__opts_group.html#gad58a5b9dabadeebda30e952ff7b39193" title="Sets the token to use when not specified in the URL.">natsOptions_SetToken</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">url</td><td>the string representing the URL the connection should use to connect to the server. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gacb7e964ae54b74d972d72e118b7b8bdf" name="gacb7e964ae54b74d972d72e118b7b8bdf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacb7e964ae54b74d972d72e118b7b8bdf">&#9670;&#160;</a></span>natsOptions_SetServers()</h2>
<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> natsOptions_SetServers </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const 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>serversCount</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This specifies a list of servers to try to connect (or reconnect) to. Note that if you call <a class="el" href="group__opts_group.html#ga3f7e760214417c7d87541ecb9ab5bea5" title="Sets the URL to connect to.">natsOptions_SetURL()</a> too, the actual list will contain the one from <a class="el" href="group__opts_group.html#ga3f7e760214417c7d87541ecb9ab5bea5" title="Sets the URL to connect to.">natsOptions_SetURL()</a> and the ones specified in this call.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__opts_group.html#ga3f7e760214417c7d87541ecb9ab5bea5" title="Sets the URL to connect to.">natsOptions_SetURL</a> </dd>
<dd>
<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> </dd>
<dd>
<a class="el" href="group__opts_group.html#gad58a5b9dabadeebda30e952ff7b39193" title="Sets the token to use when not specified in the URL.">natsOptions_SetToken</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">servers</td><td>the array of strings representing the server URLs. </td></tr>
<tr><td class="paramname">serversCount</td><td>the size of the array. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga5b99da7dd74aac3be962f323c3863d9e" name="ga5b99da7dd74aac3be962f323c3863d9e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5b99da7dd74aac3be962f323c3863d9e">&#9670;&#160;</a></span>natsOptions_SetUserInfo()</h2>
<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> natsOptions_SetUserInfo </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>user</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>password</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Credentials are usually provided through the URL in the form: <code>nats://foo:bar@localhost:4222</code>.<br />
Until now, you could specify URLs in two ways, with <a class="el" href="group__opts_group.html#gacb7e964ae54b74d972d72e118b7b8bdf" title="Set the list of servers to try to (re)connect to.">natsOptions_SetServers</a> or <a class="el" href="group__conn_mgt_group.html#gafb83c8d7970ba68be0e6c40c38cdfde4" title="Connects to a NATS Server using any of the URL from the given list.">natsConnection_ConnectTo</a>. The client library would connect (or reconnect) only to this given list of URLs, so if any of the server in the list required authentication, you were responsible for providing the appropriate credentials in the URLs.<br />
<br />
However, with cluster auto-discovery, the client library asynchronously receives URLs of servers in the cluster. These URLs do not contain any embedded credentials. <br />
You need to use this function (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>) to instruct the client library to use those credentials when connecting to a server that requires authentication and for which there is no embedded credentials in the URL.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__opts_group.html#gad58a5b9dabadeebda30e952ff7b39193" title="Sets the token to use when not specified in the URL.">natsOptions_SetToken</a> </dd>
<dd>
<a class="el" href="group__opts_group.html#ga3f7e760214417c7d87541ecb9ab5bea5" title="Sets the URL to connect to.">natsOptions_SetURL</a> </dd>
<dd>
<a class="el" href="group__opts_group.html#gacb7e964ae54b74d972d72e118b7b8bdf" title="Set the list of servers to try to (re)connect to.">natsOptions_SetServers</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">user</td><td>the user name to send to the server during connect. </td></tr>
<tr><td class="paramname">password</td><td>the password to send to the server during connect. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gad58a5b9dabadeebda30e952ff7b39193" name="gad58a5b9dabadeebda30e952ff7b39193"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad58a5b9dabadeebda30e952ff7b39193">&#9670;&#160;</a></span>natsOptions_SetToken()</h2>
<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> natsOptions_SetToken </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>token</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Tokens are usually provided through the URL in the form: <code>nats://mytoken@localhost:4222</code>.<br />
Until now, you could specify URLs in two ways, with <a class="el" href="group__opts_group.html#gacb7e964ae54b74d972d72e118b7b8bdf" title="Set the list of servers to try to (re)connect to.">natsOptions_SetServers</a> or <a class="el" href="group__conn_mgt_group.html#gafb83c8d7970ba68be0e6c40c38cdfde4" title="Connects to a NATS Server using any of the URL from the given list.">natsConnection_ConnectTo</a>. The client library would connect (or reconnect) only to this given list of URLs, so if any of the server in the list required authentication, you were responsible for providing the appropriate token in the URLs.<br />
<br />
However, with cluster auto-discovery, the client library asynchronously receives URLs of servers in the cluster. These URLs do not contain any embedded tokens. <br />
You need to use this function (or <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>) to instruct the client library to use this token when connecting to a server that requires authentication and for which there is no embedded token in the URL.</p>
<dl class="section see"><dt>See also</dt><dd><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> </dd>
<dd>
<a class="el" href="group__opts_group.html#ga3f7e760214417c7d87541ecb9ab5bea5" title="Sets the URL to connect to.">natsOptions_SetURL</a> </dd>
<dd>
<a class="el" href="group__opts_group.html#gacb7e964ae54b74d972d72e118b7b8bdf" title="Set the list of servers to try to (re)connect to.">natsOptions_SetServers</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">token</td><td>the token to send to the server during connect. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga23a3b1f022112e98ddccb18b247b4426" name="ga23a3b1f022112e98ddccb18b247b4426"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga23a3b1f022112e98ddccb18b247b4426">&#9670;&#160;</a></span>natsOptions_SetTokenHandler()</h2>
<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> natsOptions_SetTokenHandler </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__callbacks_group.html#ga4b02de70fe9380d184fd01d87527f499">natsTokenHandler</a>&#160;</td>
<td class="paramname"><em>tokenCb</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>closure</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>For use cases where setting a static token through the URL<br />
or through <a class="el" href="group__opts_group.html#gad58a5b9dabadeebda30e952ff7b39193" title="Sets the token to use when not specified in the URL.">natsOptions_SetToken</a> is not desirable.<br />
<br />
This function can be used to generate a token whenever the client needs one.<br />
Some example of use cases: expiring token, credential rotation, ...</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__opts_group.html#gad58a5b9dabadeebda30e952ff7b39193" title="Sets the token to use when not specified in the URL.">natsOptions_SetToken</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">tokenCb</td><td>the tokenCb to use to generate a token to the server during connect. </td></tr>
<tr><td class="paramname">closure</td><td>a pointer to an user defined object (can be <code>NULL</code>). See the <a class="el" href="group__callbacks_group.html#gad1a5ac566893e13dc8c81ac0e9c87afe" title="Callback used to deliver messages to the application.">natsMsgHandler</a> prototype. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gaabf8763b931dcf389c83fd95d760a413" name="gaabf8763b931dcf389c83fd95d760a413"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaabf8763b931dcf389c83fd95d760a413">&#9670;&#160;</a></span>natsOptions_SetNoRandomize()</h2>
<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> natsOptions_SetNoRandomize </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>noRandomize</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>If 'noRandomize' is true, then the list of server URLs is used in the order provided by <a class="el" href="group__opts_group.html#ga3f7e760214417c7d87541ecb9ab5bea5" title="Sets the URL to connect to.">natsOptions_SetURL()</a> + <a class="el" href="group__opts_group.html#gacb7e964ae54b74d972d72e118b7b8bdf" title="Set the list of servers to try to (re)connect to.">natsOptions_SetServers()</a>. Otherwise, the list is formed in a random order.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">noRandomize</td><td>if <code>true</code>, the list will be used as-is. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga17cd7fe41176cd98aca1184fa9352ad9" name="ga17cd7fe41176cd98aca1184fa9352ad9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga17cd7fe41176cd98aca1184fa9352ad9">&#9670;&#160;</a></span>natsOptions_SetTimeout()</h2>
<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> natsOptions_SetTimeout </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int64_t&#160;</td>
<td class="paramname"><em>timeout</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This timeout, expressed in milliseconds, is used to interrupt a (re)connect attempt to a <code>NATS Server</code>. This timeout is used both for the low level TCP connect call, and for timing out the response from the server to the client's initial <code>PING</code> protocol.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">timeout</td><td>the time, in milliseconds, allowed for an individual connect (or reconnect) to complete. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga1c529d347be0fe2eec17c7f4698e283e" name="ga1c529d347be0fe2eec17c7f4698e283e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1c529d347be0fe2eec17c7f4698e283e">&#9670;&#160;</a></span>natsOptions_SetName()</h2>
<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> natsOptions_SetName </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>name</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This name is sent as part of the <code>CONNECT</code> protocol. There is no default name.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">name</td><td>the name to set. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gaa1f09416d443fa7a6af6b695da563eba" name="gaa1f09416d443fa7a6af6b695da563eba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa1f09416d443fa7a6af6b695da563eba">&#9670;&#160;</a></span>natsOptions_SetSecure()</h2>
<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> natsOptions_SetSecure </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>secure</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Indicates to the server if the client wants a secure (SSL/TLS) connection.</p>
<p>The default is <code>false</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">secure</td><td><code>true</code> for a secure connection, <code>false</code> otherwise. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga2cd6563694a439b3949a31fd81103099" name="ga2cd6563694a439b3949a31fd81103099"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2cd6563694a439b3949a31fd81103099">&#9670;&#160;</a></span>natsOptions_LoadCATrustedCertificates()</h2>
<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> natsOptions_LoadCATrustedCertificates </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>fileName</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Loads the trusted CA certificates from a file.</p>
<p>Note that the certificates are added to a SSL context for this <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object at the time of this call, so possible errors while loading the certificates will be reported now instead of when a connection is created. You can get extra information by calling <a class="el" href="group__library_group.html#gadecfd49a58b581dbba40da77b195fd85" title="Returns the calling thread&#39;s last known error.">nats_GetLastError</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">fileName</td><td>the file containing the CA certificates. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gafb30794fc2ae74b9e0bd8fb609b901c8" name="gafb30794fc2ae74b9e0bd8fb609b901c8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafb30794fc2ae74b9e0bd8fb609b901c8">&#9670;&#160;</a></span>natsOptions_SetCATrustedCertificates()</h2>
<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> natsOptions_SetCATrustedCertificates </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>certificates</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Similar to <a class="el" href="group__opts_group.html#ga2cd6563694a439b3949a31fd81103099" title="Loads the trusted CA certificates from a file.">natsOptions_LoadCATrustedCertificates</a> expect that instead of loading from file, this loads from the given memory location.</p>
<p>If more than one certificate need to be provided, they need to be concatenated. For instance:</p>
<div class="fragment"><div class="line">const char *certs =</div>
<div class="line"> &quot;-----BEGIN CERTIFICATE-----\n&quot;</div>
<div class="line"> &quot;MIIGjzCCBHegAwIBAgIJAKT2W9SKY7o4MA0GCSqGSIb3DQEBCwUAMIGLMQswCQYD\n&quot;</div>
<div class="line"> (...)</div>
<div class="line"> &quot;-----END CERTIFICATE-----\n&quot;</div>
<div class="line"> &quot;-----BEGIN CERTIFICATE-----\n&quot;</div>
<div class="line"> &quot;MIIXyz...\n&quot;</div>
<div class="line"> (...)</div>
<div class="line"> &quot;-----END CERTIFICATE-----\n&quot;</div>
</div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__opts_group.html#ga2cd6563694a439b3949a31fd81103099" title="Loads the trusted CA certificates from a file.">natsOptions_LoadCATrustedCertificates</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">certificates</td><td>the string containing the concatenated CA certificates. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga36943e2ba53d05407cdabc4e7e96484b" name="ga36943e2ba53d05407cdabc4e7e96484b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga36943e2ba53d05407cdabc4e7e96484b">&#9670;&#160;</a></span>natsOptions_LoadCertificatesChain()</h2>
<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> natsOptions_LoadCertificatesChain </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>certsFileName</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>keyFileName</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>The certificates must be in PEM format and must be sorted starting with the subject's certificate, followed by intermediate CA certificates if applicable, and ending at the highest level (root) CA.</p>
<p>The private key file format supported is also PEM.</p>
<p>See <a class="el" href="group__opts_group.html#ga2cd6563694a439b3949a31fd81103099" title="Loads the trusted CA certificates from a file.">natsOptions_LoadCATrustedCertificates</a> regarding error reports.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">certsFileName</td><td>the file containing the client certificates. </td></tr>
<tr><td class="paramname">keyFileName</td><td>the file containing the client private key. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gae98f0f9034e93941767ab1ae6eec2c0c" name="gae98f0f9034e93941767ab1ae6eec2c0c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae98f0f9034e93941767ab1ae6eec2c0c">&#9670;&#160;</a></span>natsOptions_SetCertificatesChain()</h2>
<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> natsOptions_SetCertificatesChain </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>cert</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>key</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Similar to <a class="el" href="group__opts_group.html#ga36943e2ba53d05407cdabc4e7e96484b" title="Loads the certificate chain from a file, using the given key.">natsOptions_LoadCertificatesChain</a> expect that instead of loading from file, this loads from the given memory locations.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__opts_group.html#ga36943e2ba53d05407cdabc4e7e96484b" title="Loads the certificate chain from a file, using the given key.">natsOptions_LoadCertificatesChain()</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">cert</td><td>the memory location containing the client certificates. </td></tr>
<tr><td class="paramname">key</td><td>the memory location containing the client private key. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga5698f020e8eb3e7440eb073fe08ef62c" name="ga5698f020e8eb3e7440eb073fe08ef62c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5698f020e8eb3e7440eb073fe08ef62c">&#9670;&#160;</a></span>natsOptions_SetCiphers()</h2>
<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> natsOptions_SetCiphers </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>ciphers</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section note"><dt>Note</dt><dd>This function does not impact TLSv1.3 ciphersuites.</dd></dl>
<p>Sets the list of available ciphers. Check <a href="https://www.openssl.org/docs/man1.1.1/man1/ciphers.html">https://www.openssl.org/docs/man1.1.1/man1/ciphers.html</a> for the proper syntax. Here is an example:</p>
<blockquote class="doxtable">
<p>&zwj;"-ALL:HIGH" </p>
</blockquote>
<p>See <a class="el" href="group__opts_group.html#ga2cd6563694a439b3949a31fd81103099" title="Loads the trusted CA certificates from a file.">natsOptions_LoadCATrustedCertificates</a> regarding error reports.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">ciphers</td><td>the ciphers suite. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga2b7f144b011d8ce62941b608a8f324f0" name="ga2b7f144b011d8ce62941b608a8f324f0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2b7f144b011d8ce62941b608a8f324f0">&#9670;&#160;</a></span>natsOptions_SetCipherSuites()</h2>
<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> natsOptions_SetCipherSuites </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>ciphers</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the list of available ciphers. Check <a href="https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_ciphersuites.html">https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_ciphersuites.html</a> for the proper syntax. Here is an example:</p>
<blockquote class="doxtable">
<p>&zwj;"TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256" </p>
</blockquote>
<p>See <a class="el" href="group__opts_group.html#ga2cd6563694a439b3949a31fd81103099" title="Loads the trusted CA certificates from a file.">natsOptions_LoadCATrustedCertificates</a> regarding error reports.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">ciphers</td><td>the ciphers suite. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga0ba43ba9930df385e4781b12be9f2851" name="ga0ba43ba9930df385e4781b12be9f2851"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0ba43ba9930df385e4781b12be9f2851">&#9670;&#160;</a></span>natsOptions_SetExpectedHostname()</h2>
<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> natsOptions_SetExpectedHostname </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>hostname</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>If set, the library will check that the hostname in the server certificate matches the given <code>hostname</code>. This will occur when a connection is created, not at the time of this call.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">hostname</td><td>the expected server certificate hostname. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga6f804ec44adc299989fe623570679da3" name="ga6f804ec44adc299989fe623570679da3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6f804ec44adc299989fe623570679da3">&#9670;&#160;</a></span>natsOptions_SkipServerVerification()</h2>
<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> natsOptions_SkipServerVerification </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>skip</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>By default, the server certificate is verified. You can disable the verification by passing <code>true</code> to this function.</p>
<dl class="section warning"><dt>Warning</dt><dd>This is fine for tests but use with caution since this is not secure.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">skip</td><td>set it to <code>true</code> to disable - or skip - server certificate verification. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gaa16bfd09ef318af18c27a0e199681b69" name="gaa16bfd09ef318af18c27a0e199681b69"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa16bfd09ef318af18c27a0e199681b69">&#9670;&#160;</a></span>natsOptions_SetVerbose()</h2>
<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> natsOptions_SetVerbose </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>verbose</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the verbose mode. If <code>true</code>, sends are echoed by the server with an <code>OK</code> protocol message.</p>
<p>The default is <code>false</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">verbose</td><td><code>true</code> for a verbose protocol, <code>false</code> otherwise. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga26f166af20de98bec67bc6cc916f769e" name="ga26f166af20de98bec67bc6cc916f769e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga26f166af20de98bec67bc6cc916f769e">&#9670;&#160;</a></span>natsOptions_SetPedantic()</h2>
<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> natsOptions_SetPedantic </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>pedantic</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the pedantic mode. If <code>true</code> some extra checks will be performed by the server.</p>
<p>The default is <code>false</code></p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">pedantic</td><td><code>true</code> for a pedantic protocol, <code>false</code> otherwise. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gae68fb615835364c0809555e8dc93f57e" name="gae68fb615835364c0809555e8dc93f57e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae68fb615835364c0809555e8dc93f57e">&#9670;&#160;</a></span>natsOptions_SetPingInterval()</h2>
<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> natsOptions_SetPingInterval </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int64_t&#160;</td>
<td class="paramname"><em>interval</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Interval, expressed in milliseconds, in which the client sends <code>PING</code> protocols to the <code>NATS Server</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">interval</td><td>the interval, in milliseconds, at which the connection will send <code>PING</code> protocols to the server. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gaaff89c3f41627f4b2929dbc9b82d265b" name="gaaff89c3f41627f4b2929dbc9b82d265b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaff89c3f41627f4b2929dbc9b82d265b">&#9670;&#160;</a></span>natsOptions_SetMaxPingsOut()</h2>
<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> natsOptions_SetMaxPingsOut </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>maxPingsOut</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Specifies the maximum number of <code>PING</code>s without corresponding <code>PONG</code>s (which should be received from the server) before closing the connection with the <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80aa76d5e3ce051bc7510be90e73663c93d">NATS_STALE_CONNECTION</a> status. If reconnection is allowed, the client library will try to reconnect.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">maxPingsOut</td><td>the maximum number of <code>PING</code>s without <code>PONG</code>s (positive number). </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga1a3e3abfd7ddd8aff247df8f332bbda3" name="ga1a3e3abfd7ddd8aff247df8f332bbda3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1a3e3abfd7ddd8aff247df8f332bbda3">&#9670;&#160;</a></span>natsOptions_SetIOBufSize()</h2>
<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> natsOptions_SetIOBufSize </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>ioBufSize</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the size, in bytes, of the internal read/write buffers used for reading/writing data from a socket. If not specified, or the value is 0, the library will use a default value, currently set to 32KB.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">ioBufSize</td><td>the size, in bytes, of the internal buffer for read/write operations. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga3d1d3cb2f2a0e23d27dd60e96d1cc91b" name="ga3d1d3cb2f2a0e23d27dd60e96d1cc91b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3d1d3cb2f2a0e23d27dd60e96d1cc91b">&#9670;&#160;</a></span>natsOptions_SetAllowReconnect()</h2>
<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> natsOptions_SetAllowReconnect </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>allow</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Specifies whether or not the client library should try to reconnect when losing the connection to the <code>NATS Server</code>.</p>
<p>The default is <code>true</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">allow</td><td><code>true</code> if the connection is allowed to reconnect, <code>false</code> otherwise. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gab54cd2719c0b64eebd6c7b83dd2908a0" name="gab54cd2719c0b64eebd6c7b83dd2908a0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab54cd2719c0b64eebd6c7b83dd2908a0">&#9670;&#160;</a></span>natsOptions_SetMaxReconnect()</h2>
<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> natsOptions_SetMaxReconnect </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>maxReconnect</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Specifies the maximum number of reconnect attempts.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">maxReconnect</td><td>the maximum number of reconnects (positive number). </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga2730f4e16e318a2ef8de98dbf6ede807" name="ga2730f4e16e318a2ef8de98dbf6ede807"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2730f4e16e318a2ef8de98dbf6ede807">&#9670;&#160;</a></span>natsOptions_SetReconnectWait()</h2>
<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> natsOptions_SetReconnectWait </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int64_t&#160;</td>
<td class="paramname"><em>reconnectWait</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Specifies how long to wait between two reconnect attempts from the same server. This means that if you have a list with S1,S2 and are currently connected to S1, and get disconnected, the library will immediately attempt to connect to S2. If this fails, it will go back to S1, and this time will wait for <code>reconnectWait</code> milliseconds since the last attempt to connect to S1.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">reconnectWait</td><td>the time, in milliseconds, to wait between attempts to reconnect to the same server. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga8f3df57ed8ae418d3ae6678ae5e2a5d2" name="ga8f3df57ed8ae418d3ae6678ae5e2a5d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8f3df57ed8ae418d3ae6678ae5e2a5d2">&#9670;&#160;</a></span>natsOptions_SetReconnectJitter()</h2>
<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> natsOptions_SetReconnectJitter </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int64_t&#160;</td>
<td class="paramname"><em>jitter</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int64_t&#160;</td>
<td class="paramname"><em>jitterTLS</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>After a disconnect, the library will try to reconnect to any server URLs in its list (the URLs are either provided by the user or discovered through gossip protocol).</p>
<p>After the library failed to reconnect to every server in the list, it will wait for <code>reconnectWait</code> as specified with <a class="el" href="group__opts_group.html#ga2730f4e16e318a2ef8de98dbf6ede807" title="Sets the time between reconnect attempts.">natsOptions_SetReconnectWait()</a>. This option adds some random jitter to the reconnect wait delay.</p>
<p>This will help minimize the thundering herd phenomenon. For instance, suppose a server has 1000 connections, all were created at different times, but have the same reconnect wait option. If this server suddenly stops, then all connections will detect the failure and initiate a reconnect at the same time. The issue is even greater when those connections are TLS because of the added cost of the TLS handshake.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__opts_group.html#ga2730f4e16e318a2ef8de98dbf6ede807" title="Sets the time between reconnect attempts.">natsOptions_SetReconnectWait()</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">jitter</td><td>the jitter in milliseconds for non TLS connections. </td></tr>
<tr><td class="paramname">jitterTLS</td><td>the jitter in milliseconds for TLS connections. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga3593165aa113d6736e0226ddc56b3e9d" name="ga3593165aa113d6736e0226ddc56b3e9d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3593165aa113d6736e0226ddc56b3e9d">&#9670;&#160;</a></span>natsOptions_SetCustomReconnectDelay()</h2>
<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> natsOptions_SetCustomReconnectDelay </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__callbacks_group.html#ga3353d4b92851c52121f65aaf0684cba4">natsCustomReconnectDelayHandler</a>&#160;</td>
<td class="paramname"><em>cb</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>closure</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This callback is invoked after the library tried every URL in the server list and failed to reconnect. It passes to the user the current number of attempts. This function shall return the amount of time the library will sleep before attempting to reconnect again.</p>
<p>It is strongly recommended that this value contains some jitter to prevent all connections to attempt reconnecting at the same time.</p>
<dl class="section note"><dt>Note</dt><dd>When using this approach, the reconnect wait as specified by <a class="el" href="group__opts_group.html#ga2730f4e16e318a2ef8de98dbf6ede807" title="Sets the time between reconnect attempts.">natsOptions_SetReconnectWait()</a> is ignored.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">cb</td><td>the custom reconnect delay handler to invoke. </td></tr>
<tr><td class="paramname">closure</td><td>a pointer to an user defined object (can be <code>NULL</code>). See the <a class="el" href="group__callbacks_group.html#ga3353d4b92851c52121f65aaf0684cba4" title="Callback used to specify how long to wait between reconnects.">natsCustomReconnectDelayHandler</a> prototype. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gaa0d4b7ece8477cb9879f0dafff3456a5" name="gaa0d4b7ece8477cb9879f0dafff3456a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa0d4b7ece8477cb9879f0dafff3456a5">&#9670;&#160;</a></span>natsOptions_SetReconnectBufSize()</h2>
<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> natsOptions_SetReconnectBufSize </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>reconnectBufSize</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the size, in bytes, of the backing buffer holding published data while the library is reconnecting. Once this buffer has been exhausted, publish operations will return the <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80a317fb9be1a80f6b1877f96a9a2db16ad" title="A buffer is not large enough to accommodate the data.">NATS_INSUFFICIENT_BUFFER</a> error. If not specified, or the value is 0, the library will use a default value, currently set to 8MB.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">reconnectBufSize</td><td>the size, in bytes, of the backing buffer for write operations during a reconnect. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga95510436eee06f9992ded96a44795c40" name="ga95510436eee06f9992ded96a44795c40"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga95510436eee06f9992ded96a44795c40">&#9670;&#160;</a></span>natsOptions_SetMaxPendingMsgs()</h2>
<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> natsOptions_SetMaxPendingMsgs </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>maxPending</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Specifies the maximum number of inbound messages that can be buffered in the library, for each subscription, before inbound messages are dropped and <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80ae93ff5b7fe31f8570308385d92d317b0">NATS_SLOW_CONSUMER</a> status is reported to the <a class="el" href="group__callbacks_group.html#ga9e511dffa471dfb971b7dd2b12329626" title="Callback used to notify the user of errors encountered while processing inbound messages.">natsErrHandler</a> callback (if one has been set).</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__opts_group.html#ga127ec7a8196b453947a7fa9a64096cbd" title="Sets the error handler for asynchronous events.">natsOptions_SetErrorHandler()</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">maxPending</td><td>the number of messages allowed to be buffered by the library before triggering a slow consumer scenario. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga127ec7a8196b453947a7fa9a64096cbd" name="ga127ec7a8196b453947a7fa9a64096cbd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga127ec7a8196b453947a7fa9a64096cbd">&#9670;&#160;</a></span>natsOptions_SetErrorHandler()</h2>
<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> natsOptions_SetErrorHandler </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__callbacks_group.html#ga9e511dffa471dfb971b7dd2b12329626">natsErrHandler</a>&#160;</td>
<td class="paramname"><em>errHandler</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>closure</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Specifies the callback to invoke when an asynchronous error occurs. This is used by applications having only asynchronous subscriptions that would not know otherwise that a problem with the connection occurred.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__callbacks_group.html#ga9e511dffa471dfb971b7dd2b12329626" title="Callback used to notify the user of errors encountered while processing inbound messages.">natsErrHandler</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">errHandler</td><td>the error handler callback. </td></tr>
<tr><td class="paramname">closure</td><td>a pointer to an user object that will be passed to the callback. <code>closure</code> can be <code>NULL</code>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga44410242e73134e5bb51ef27904a9253" name="ga44410242e73134e5bb51ef27904a9253"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga44410242e73134e5bb51ef27904a9253">&#9670;&#160;</a></span>natsOptions_SetClosedCB()</h2>
<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> natsOptions_SetClosedCB </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__callbacks_group.html#gacdef6aff3e47953f19e35857ab8e274c">natsConnectionHandler</a>&#160;</td>
<td class="paramname"><em>closedCb</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>closure</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Specifies the callback to invoke when a connection is terminally closed, that is, after all reconnect attempts have failed (when reconnection is allowed).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">closedCb</td><td>the callback to be invoked when the connection is closed. </td></tr>
<tr><td class="paramname">closure</td><td>a pointer to an user object that will be passed to the callback. <code>closure</code> can be <code>NULL</code>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gadc8dc0cedd91bda71d544f3dedc4a039" name="gadc8dc0cedd91bda71d544f3dedc4a039"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadc8dc0cedd91bda71d544f3dedc4a039">&#9670;&#160;</a></span>natsOptions_SetDisconnectedCB()</h2>
<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> natsOptions_SetDisconnectedCB </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__callbacks_group.html#gacdef6aff3e47953f19e35857ab8e274c">natsConnectionHandler</a>&#160;</td>
<td class="paramname"><em>disconnectedCb</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>closure</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Specifies the callback to invoke when a connection to the <code>NATS Server</code> is lost.</p>
<dl class="section warning"><dt>Warning</dt><dd>Invocation of this callback is asynchronous, which means that the state of the connection may have changed when this callback is invoked.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">disconnectedCb</td><td>the callback to be invoked when a connection to a server is lost </td></tr>
<tr><td class="paramname">closure</td><td>a pointer to an user object that will be passed to the callback. <code>closure</code> can be <code>NULL</code>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga26a48c8529fffa5f5d1a61c030979980" name="ga26a48c8529fffa5f5d1a61c030979980"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga26a48c8529fffa5f5d1a61c030979980">&#9670;&#160;</a></span>natsOptions_SetReconnectedCB()</h2>
<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> natsOptions_SetReconnectedCB </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__callbacks_group.html#gacdef6aff3e47953f19e35857ab8e274c">natsConnectionHandler</a>&#160;</td>
<td class="paramname"><em>reconnectedCb</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>closure</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Specifies the callback to invoke when the client library has successfully reconnected to a <code>NATS Server</code>.</p>
<dl class="section warning"><dt>Warning</dt><dd>Invocation of this callback is asynchronous, which means that the state of the connection may have changed when this callback is invoked.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">reconnectedCb</td><td>the callback to be invoked when the connection to a server has been re-established. </td></tr>
<tr><td class="paramname">closure</td><td>a pointer to an user object that will be passed to the callback. <code>closure</code> can be <code>NULL</code>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gab5baab507c974402ab0d8c5e8227ee65" name="gab5baab507c974402ab0d8c5e8227ee65"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab5baab507c974402ab0d8c5e8227ee65">&#9670;&#160;</a></span>natsOptions_SetDiscoveredServersCB()</h2>
<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> natsOptions_SetDiscoveredServersCB </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__callbacks_group.html#gacdef6aff3e47953f19e35857ab8e274c">natsConnectionHandler</a>&#160;</td>
<td class="paramname"><em>discoveredServersCb</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>closure</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Specifies the callback to invoke when the client library has been notified of one or more new <code>NATS Servers</code>.</p>
<dl class="section warning"><dt>Warning</dt><dd>Invocation of this callback is asynchronous, which means that the state may have changed when this callback is invoked.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">discoveredServersCb</td><td>the callback to be invoked when new servers have been discovered. </td></tr>
<tr><td class="paramname">closure</td><td>a pointer to an user object that will be passed to the callback. <code>closure</code> can be <code>NULL</code>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga7e4172084520708b8c9f28e73174461c" name="ga7e4172084520708b8c9f28e73174461c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7e4172084520708b8c9f28e73174461c">&#9670;&#160;</a></span>natsOptions_SetIgnoreDiscoveredServers()</h2>
<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> natsOptions_SetIgnoreDiscoveredServers </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>ignore</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>By default, when a server joins a cluster, a client is notified of the new URL and added to the list so it can be used in case of a reconnect.</p>
<p>The servers can be configured to disable this gossip, however, if not done at the servers level, this option allows the discovered servers to be ignored.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">ignore</td><td>if discovered server should be ignored or not. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga54dea2ffeb33779771652a7a14fc4adc" name="ga54dea2ffeb33779771652a7a14fc4adc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga54dea2ffeb33779771652a7a14fc4adc">&#9670;&#160;</a></span>natsOptions_SetLameDuckModeCB()</h2>
<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> natsOptions_SetLameDuckModeCB </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__callbacks_group.html#gacdef6aff3e47953f19e35857ab8e274c">natsConnectionHandler</a>&#160;</td>
<td class="paramname"><em>lameDuckCb</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>closure</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Specifies the callback to invoke when the server notifies the connection that it entered lame duck mode, that is, going to gradually disconnect all its connections before shuting down. This is often used in deployments when upgrading NATS Servers.</p>
<dl class="section warning"><dt>Warning</dt><dd>Invocation of this callback is asynchronous, which means that the state may have changed when this callback is invoked.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">lameDuckCb</td><td>the callback to be invoked when server enters lame duck mode. </td></tr>
<tr><td class="paramname">closure</td><td>a pointer to an user object that will be passed to the callback. <code>closure</code> can be <code>NULL</code>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gab09491bad908dedcb323c780280733ff" name="gab09491bad908dedcb323c780280733ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab09491bad908dedcb323c780280733ff">&#9670;&#160;</a></span>natsOptions_SetEventLoop()</h2>
<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> natsOptions_SetEventLoop </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>loop</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__callbacks_group.html#ga245eab0a01a485e40fba267f84ec037f">natsEvLoop_Attach</a>&#160;</td>
<td class="paramname"><em>attachCb</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__callbacks_group.html#gaea4c125ecfb43eaf43da20e8444c2aaa">natsEvLoop_ReadAddRemove</a>&#160;</td>
<td class="paramname"><em>readCb</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__callbacks_group.html#ga2bb5dd2d821ca5bbc0488f7e6aceed17">natsEvLoop_WriteAddRemove</a>&#160;</td>
<td class="paramname"><em>writeCb</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__callbacks_group.html#gab63dee7f7012ba11ae20b76dbc36f2d0">natsEvLoop_Detach</a>&#160;</td>
<td class="paramname"><em>detachCb</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>If you want to use an external event loop, the <code>NATS</code> library will not create a thread to read data from the socket, and will not directly write data to the socket. Instead, the library will invoke those callbacks for various events.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">loop</td><td>the <code>void*</code> pointer to the external event loop. </td></tr>
<tr><td class="paramname">attachCb</td><td>the callback invoked after the connection is connected, or reconnected. </td></tr>
<tr><td class="paramname">readCb</td><td>the callback invoked when the event library should start or stop polling for read events. </td></tr>
<tr><td class="paramname">writeCb</td><td>the callback invoked when the event library should start or stop polling for write events. </td></tr>
<tr><td class="paramname">detachCb</td><td>the callback invoked when a connection is closed. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gabf060c92648b50c069f0abe7cbb06f1c" name="gabf060c92648b50c069f0abe7cbb06f1c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabf060c92648b50c069f0abe7cbb06f1c">&#9670;&#160;</a></span>natsOptions_UseGlobalMessageDelivery()</h2>
<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> natsOptions_UseGlobalMessageDelivery </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>global</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Normally, each asynchronous subscriber that is created has its own message delivery thread. The advantage is that it reduces lock contentions, therefore improving performance.<br />
However, if an application creates many subscribers, this is not scaling well since the process would use too many threads.</p>
<p>When a connection is created from a <code>nats_Options</code> that has enabled global message delivery, asynchronous subscribers from this connection will use a shared thread pool responsible for message delivery.</p>
<dl class="section note"><dt>Note</dt><dd>The message order per subscription is still guaranteed.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__library_group.html#gab21e94ce7a7d226611ea2c05914cf19d" title="Sets the maximum size of the global message delivery thread pool.">nats_SetMessageDeliveryPoolSize()</a> </dd>
<dd>
<a class="el" href="group__env_variables_group.html">Environment Variables</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">global</td><td>if <code>true</code>, uses the global message delivery thread pool, otherwise, each asynchronous subscriber will create their own message delivery thread. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga7ca713c7532eff4d41a492e95b8822cf" name="ga7ca713c7532eff4d41a492e95b8822cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7ca713c7532eff4d41a492e95b8822cf">&#9670;&#160;</a></span>natsOptions_IPResolutionOrder()</h2>
<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> natsOptions_IPResolutionOrder </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>order</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>The library would previously favor IPv6 addresses during the connect process. <br />
You can now change the order, or even exclude a family of addresses, using this option. Here is the list of possible values: <br />
</p><table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Value </th><th class="markdownTableHeadNone">Meaning </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">46 </td><td class="markdownTableBodyNone">try IPv4 first, if it fails try IPv6 </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">64 </td><td class="markdownTableBodyNone">try IPv6 first, if it fails try IPv4 </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">4 </td><td class="markdownTableBodyNone">use only IPv4 </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">6 </td><td class="markdownTableBodyNone">use only IPv6 </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">0 </td><td class="markdownTableBodyNone">any family, no specific order </td></tr>
</table>
<dl class="section note"><dt>Note</dt><dd>If this option is not set, or you specify <code>0</code> for the order, the library will use the first IP (based on the DNS configuration) for which a successful connection can be made.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">order</td><td>a string representing the order for the IP resolution. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga8f06568cc3319a5a0eef9f80282034ca" name="ga8f06568cc3319a5a0eef9f80282034ca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8f06568cc3319a5a0eef9f80282034ca">&#9670;&#160;</a></span>natsOptions_SetSendAsap()</h2>
<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> natsOptions_SetSendAsap </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>sendAsap</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>For throughput performance, the client library tries by default to buffer as much data as possible before sending it over TCP.</p>
<p>Setting this option to <code>true</code> will make Publish calls send the data right away, reducing latency, but also throughput.</p>
<p>A good use-case would be a connection used to solely send replies. Imagine, a requestor sending a request, waiting for the reply before sending the next request.<br />
The replier application will send only one reply at a time (since it will not receive the next request until the requestor receives the reply).<br />
In such case, it makes sense for the reply to be sent right away.</p>
<p>The alternative would be to call <a class="el" href="group__conn_mgt_group.html#ga1c98f8d89bb8e20ea8621e860a90267f" title="Flushes the connection.">natsConnection_Flush()</a>, but this call requires a round-trip with the server, which is less efficient than using this option.</p>
<p>Note that the Request() call already automatically sends the request as fast as possible, there is no need to set an option for that.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">sendAsap</td><td>a boolean indicating if published data should be sent right away or be buffered. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga70aa85319933d78c0076cc862fa3e5a6" name="ga70aa85319933d78c0076cc862fa3e5a6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga70aa85319933d78c0076cc862fa3e5a6">&#9670;&#160;</a></span>natsOptions_UseOldRequestStyle()</h2>
<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> natsOptions_UseOldRequestStyle </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>useOldStyle</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Setting <code>useOldStyle</code> to <code>true</code> forces the request calls to use the original behavior, which is to create a new inbox, a new subscription on that inbox and set auto-unsubscribe to 1.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">useOldStyle</td><td>a boolean indicating if old request style should be used. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gadef4376a5e608cbc8c1a9e2b6335dc79" name="gadef4376a5e608cbc8c1a9e2b6335dc79"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadef4376a5e608cbc8c1a9e2b6335dc79">&#9670;&#160;</a></span>natsOptions_SetFailRequestsOnDisconnect()</h2>
<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> natsOptions_SetFailRequestsOnDisconnect </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>failRequests</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>If this option is enabled, all pending <a class="el" href="group__conn_pub_group.html#gaf4b4a022f9c21fc269b87c000330c5a7" title="Sends a request and waits for a reply.">natsConnection_Request()</a> family calls will fail with the <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80abef517217119e8446a8e3382e1f37eb3">NATS_CONNECTION_DISCONNECTED</a> status.</p>
<dl class="section note"><dt>Note</dt><dd>This does not apply to requests from connections that use the old style requests.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__opts_group.html#ga70aa85319933d78c0076cc862fa3e5a6" title="Switches the use of old style requests.">natsOptions_UseOldRequestStyle</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">failRequests</td><td>a boolean indicating if pending requests should fail when a disconnect event occurs. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga4f694b87039cedaa65cd25656b14d1a3" name="ga4f694b87039cedaa65cd25656b14d1a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4f694b87039cedaa65cd25656b14d1a3">&#9670;&#160;</a></span>natsOptions_SetNoEcho()</h2>
<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> natsOptions_SetNoEcho </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>noEcho</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This configures whether the server will echo back messages that are sent on this connection if there is also matching subscriptions.</p>
<p>Set this to <code>true</code> to prevent the server from sending back messages produced by this connection. The default is false, that is, messages originating from this connection will be sent by the server if the connection has matching subscriptions.</p>
<dl class="section note"><dt>Note</dt><dd>This is supported on servers &gt;= version 1.2.0. Calling <a class="el" href="group__conn_mgt_group.html#ga740be1ba16a8570eb98ef6755ebf52ce" title="Connects to a NATS Server using the provided options.">natsConnection_Connect()</a> with the option set to <code>true</code> to server below this version will return the <code>NATS_NO_SERVER_SUPPORT</code> error.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">noEcho</td><td>a boolean indicating if sent messages can be delivered back to this connection or not. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga20946800d024b7089e73d63454d1c19f" name="ga20946800d024b7089e73d63454d1c19f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga20946800d024b7089e73d63454d1c19f">&#9670;&#160;</a></span>natsOptions_SetRetryOnFailedConnect()</h2>
<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> natsOptions_SetRetryOnFailedConnect </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>retry</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__callbacks_group.html#gacdef6aff3e47953f19e35857ab8e274c">natsConnectionHandler</a>&#160;</td>
<td class="paramname"><em>connectedCb</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>closure</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>By default, <a class="el" href="group__conn_mgt_group.html#ga740be1ba16a8570eb98ef6755ebf52ce" title="Connects to a NATS Server using the provided options.">natsConnection_Connect()</a> attempts to connect to a server specified in provided list of servers. If it cannot connect and the list has been fully tried, the function returns an error.</p>
<p>This option is used to changed this default behavior.</p>
<p>If <code>retry</code> is set to <code>true</code> and connection cannot be established right away, the library will attempt to connect based on the reconnect attempts and delay settings.</p>
<dl class="section note"><dt>Note</dt><dd>The connect retry logic uses reconnect settings even if <a class="el" href="group__opts_group.html#ga3d1d3cb2f2a0e23d27dd60e96d1cc91b" title="Indicates if the connection will be allowed to reconnect.">natsOptions_SetAllowReconnect()</a> has been set to false. In other words, a failed connect may be retried even though a reconnect will not be allowed should the connection to the server be lost after initial connect.</dd></dl>
<p>The behavior will then depend on the value of the <code>connectedCb</code> parameter:</p>
<ul>
<li>If <code>NULL</code>, then the call blocks until it can connect or exhausts the reconnect attempts.</li>
<li>If not <code>NULL</code>, and no connection can be immediately established, the <a class="el" href="group__conn_mgt_group.html#ga740be1ba16a8570eb98ef6755ebf52ce" title="Connects to a NATS Server using the provided options.">natsConnection_Connect()</a> calls returns <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80a49a1ea653ce112b3c53eedebcd60811d">NATS_NOT_YET_CONNECTED</a> to indicate that no connection is currently established, but will try asynchronously to connect using the reconnect attempts/delay settings. If the connection is later established, the specified callback will be invoked. If no connection can be made and the retry attempts are exhausted, the callback registered with <a class="el" href="group__opts_group.html#ga44410242e73134e5bb51ef27904a9253" title="Sets the callback to be invoked when a connection to a server is permanently lost.">natsOptions_SetClosedCB()</a>, if any, will be invoked.</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>If <a class="el" href="group__conn_mgt_group.html#ga740be1ba16a8570eb98ef6755ebf52ce" title="Connects to a NATS Server using the provided options.">natsConnection_Connect()</a> returns <code>NATS_OK</code> (that is, a connection to a <code>NATS Server</code> was established in that call), then the <code>connectedCb</code> callback will not be invoked.</dd></dl>
<p>If <code>retry</code> is set to false, <a class="el" href="group__conn_mgt_group.html#ga740be1ba16a8570eb98ef6755ebf52ce" title="Connects to a NATS Server using the provided options.">natsConnection_Connect()</a> behaves as originally designed, that is, returns an error and no connection object if failing to connect to any server in the list.</p>
<dl class="section note"><dt>Note</dt><dd>The <code>connectedCb</code> parameter is ignored and set to <code>NULL</code> in the options object when <code>retry</code> is set to <code>false</code>.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__opts_group.html#gab54cd2719c0b64eebd6c7b83dd2908a0" title="Sets the maximum number of reconnect attempts.">natsOptions_SetMaxReconnect()</a> </dd>
<dd>
<a class="el" href="group__opts_group.html#ga2730f4e16e318a2ef8de98dbf6ede807" title="Sets the time between reconnect attempts.">natsOptions_SetReconnectWait()</a> </dd>
<dd>
<a class="el" href="group__opts_group.html#ga44410242e73134e5bb51ef27904a9253" title="Sets the callback to be invoked when a connection to a server is permanently lost.">natsOptions_SetClosedCB()</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">retry</td><td>a boolean indicating if a failed connect should be retried. </td></tr>
<tr><td class="paramname">connectedCb</td><td>if <code>retry</code> is true and this is not <code>NULL</code>, then the connect may be asynchronous and this callback will be invoked if the connect succeeds. </td></tr>
<tr><td class="paramname">closure</td><td>a pointer to an user object that will be passed to the callback. <code>closure</code> can be <code>NULL</code>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga60117450fc1f7b6f81bab455aeed7515" name="ga60117450fc1f7b6f81bab455aeed7515"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga60117450fc1f7b6f81bab455aeed7515">&#9670;&#160;</a></span>natsOptions_SetUserCredentialsCallbacks()</h2>
<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> natsOptions_SetUserCredentialsCallbacks </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__callbacks_group.html#ga258b30458134be90f17315c037f34b7b">natsUserJWTHandler</a>&#160;</td>
<td class="paramname"><em>ujwtCB</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>ujwtClosure</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__callbacks_group.html#gab786ffd670c86de0563559351305080b">natsSignatureHandler</a>&#160;</td>
<td class="paramname"><em>sigCB</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>sigClosure</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Any time the library creates a TCP connection to the server, the server in response sends an <code>INFO</code> protocol. That <code>INFO</code> protocol, for NATS Server at v2.0.0+, may include a <code>nonce</code> for the client to sign.</p>
<p>If this option is set, the library will invoke the two handlers to fetch the user JWT and sign the server's nonce.</p>
<p>This is an option that will be used only by users that are able to sign using Ed25519 (public-key signature system). Most users will probably prefer the user of <a class="el" href="group__opts_group.html#ga59b47f7b7a19085cf8eaada9bfe5606e" title="Sets the file(s) to use to fetch user JWT and seed required to sign nonce.">natsOptions_SetUserCredentialsFromFiles()</a>.</p>
<dl class="section note"><dt>Note</dt><dd><a class="el" href="group__opts_group.html#ga60117450fc1f7b6f81bab455aeed7515" title="Sets the callbacks to fetch user JWT and sign server&#39;s nonce.">natsOptions_SetUserCredentialsCallbacks()</a> and <a class="el" href="group__opts_group.html#ga0290eac4665569c850468d9f00e246a0" title="Sets the NKey public key and signature callback.">natsOptions_SetNKey()</a> are mutually exclusive. Calling this function will remove the NKey and replace the signature handler, that was set with <a class="el" href="group__opts_group.html#ga0290eac4665569c850468d9f00e246a0" title="Sets the NKey public key and signature callback.">natsOptions_SetNKey()</a>, with this one.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__callbacks_group.html#ga258b30458134be90f17315c037f34b7b" title="Callback used to fetch and return account signed user JWT.">natsUserJWTHandler</a> </dd>
<dd>
<a class="el" href="group__callbacks_group.html#gab786ffd670c86de0563559351305080b" title="Callback used to sign a nonce sent by the server.">natsSignatureHandler</a> </dd>
<dd>
<a class="el" href="group__opts_group.html#ga59b47f7b7a19085cf8eaada9bfe5606e" title="Sets the file(s) to use to fetch user JWT and seed required to sign nonce.">natsOptions_SetUserCredentialsFromFiles()</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">ujwtCB</td><td>the callback to invoke to fetch the user JWT. </td></tr>
<tr><td class="paramname">ujwtClosure</td><td>the closure that will be passed to the <code>ujwtCB</code> callback. </td></tr>
<tr><td class="paramname">sigCB</td><td>the callback to invoke to sign the server nonce. </td></tr>
<tr><td class="paramname">sigClosure</td><td>the closure that will be passed to the <code>sigCB</code> callback. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga59b47f7b7a19085cf8eaada9bfe5606e" name="ga59b47f7b7a19085cf8eaada9bfe5606e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga59b47f7b7a19085cf8eaada9bfe5606e">&#9670;&#160;</a></span>natsOptions_SetUserCredentialsFromFiles()</h2>
<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> natsOptions_SetUserCredentialsFromFiles </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>userOrChainedFile</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>seedFile</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This is a convenient option that specifies the files(s) to use to fetch the user JWT and the user seed to be used to sign the server's nonce.</p>
<p>The <code>userOrChainedFile</code> contains the user JWT token and possibly the user NKey seed. Note the format of this file:</p>
<div class="fragment"><div class="line">-----BEGIN NATS USER JWT-----</div>
<div class="line">...an user JWT token...</div>
<div class="line">------END NATS USER JWT------</div>
<div class="line"> </div>
<div class="line">************************* IMPORTANT *************************</div>
<div class="line">NKEY Seed printed below can be used to sign and prove identity.</div>
<div class="line">NKEYs are sensitive and should be treated as secrets.</div>
<div class="line"> </div>
<div class="line">-----BEGIN USER NKEY SEED-----</div>
<div class="line">SU...</div>
<div class="line">------END USER NKEY SEED------</div>
</div><!-- fragment --><p>The <code>---BEGIN NATS USER JWT---</code> header is used to detect where the user JWT is in this file.</p>
<p>If the file does not contain the user NKey seed, then the <code>seedFile</code> file name must be specified and must contain the user NKey seed.</p>
<dl class="section note"><dt>Note</dt><dd><a class="el" href="group__opts_group.html#ga59b47f7b7a19085cf8eaada9bfe5606e" title="Sets the file(s) to use to fetch user JWT and seed required to sign nonce.">natsOptions_SetUserCredentialsFromFiles()</a> and <a class="el" href="group__opts_group.html#ga0290eac4665569c850468d9f00e246a0" title="Sets the NKey public key and signature callback.">natsOptions_SetNKey()</a> are mutually exclusive. Calling this function will remove the NKey and replace the signature handler, that was set with <a class="el" href="group__opts_group.html#ga0290eac4665569c850468d9f00e246a0" title="Sets the NKey public key and signature callback.">natsOptions_SetNKey()</a>, with an internal one that will handle the signature.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">userOrChainedFile</td><td>the name of the file containing the user JWT and possibly the user NKey seed. </td></tr>
<tr><td class="paramname">seedFile</td><td>the name of the file containing the user NKey seed. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga5d3d4d1269dd289f93c56b8a1ddccd43" name="ga5d3d4d1269dd289f93c56b8a1ddccd43"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5d3d4d1269dd289f93c56b8a1ddccd43">&#9670;&#160;</a></span>natsOptions_SetUserCredentialsFromMemory()</h2>
<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> natsOptions_SetUserCredentialsFromMemory </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>jwtAndSeedContent</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This function acts similarly to <a class="el" href="group__opts_group.html#ga59b47f7b7a19085cf8eaada9bfe5606e" title="Sets the file(s) to use to fetch user JWT and seed required to sign nonce.">natsOptions_SetUserCredentialsFromFiles()</a> but reads from memory instead from a file. Also it assumes that <code>jwtAndSeedContent</code> contains both the JWT and NKey seed.</p>
<p>As for the format, see <a class="el" href="group__opts_group.html#ga59b47f7b7a19085cf8eaada9bfe5606e" title="Sets the file(s) to use to fetch user JWT and seed required to sign nonce.">natsOptions_SetUserCredentialsFromFiles()</a> documentation.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__opts_group.html#ga59b47f7b7a19085cf8eaada9bfe5606e" title="Sets the file(s) to use to fetch user JWT and seed required to sign nonce.">natsOptions_SetUserCredentialsFromFiles()</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">jwtAndSeedContent</td><td>string containing user JWT and user NKey seed. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga0290eac4665569c850468d9f00e246a0" name="ga0290eac4665569c850468d9f00e246a0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0290eac4665569c850468d9f00e246a0">&#9670;&#160;</a></span>natsOptions_SetNKey()</h2>
<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> natsOptions_SetNKey </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>pubKey</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__callbacks_group.html#gab786ffd670c86de0563559351305080b">natsSignatureHandler</a>&#160;</td>
<td class="paramname"><em>sigCB</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>sigClosure</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Any time the library creates a TCP connection to the server, the server in response sends an <code>INFO</code> protocol. That <code>INFO</code> protocol, for NATS Server at v2.0.0+, may include a <code>nonce</code> for the client to sign.</p>
<p>If this option is set, the library will add the NKey public key <code>pubKey</code> to the <code>CONNECT</code> protocol along with the server's nonce signature resulting from the invocation of the signature handler <code>sigCB</code>.</p>
<dl class="section note"><dt>Note</dt><dd><a class="el" href="group__opts_group.html#ga0290eac4665569c850468d9f00e246a0" title="Sets the NKey public key and signature callback.">natsOptions_SetNKey()</a> and <a class="el" href="group__opts_group.html#ga60117450fc1f7b6f81bab455aeed7515" title="Sets the callbacks to fetch user JWT and sign server&#39;s nonce.">natsOptions_SetUserCredentialsCallbacks()</a> or <a class="el" href="group__opts_group.html#ga59b47f7b7a19085cf8eaada9bfe5606e" title="Sets the file(s) to use to fetch user JWT and seed required to sign nonce.">natsOptions_SetUserCredentialsFromFiles()</a> are mutually exclusive. Calling this function will remove the user JWT callback and replace the signature handler, that was set with one of the user credentials options, with this one.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__callbacks_group.html#gab786ffd670c86de0563559351305080b" title="Callback used to sign a nonce sent by the server.">natsSignatureHandler</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">pubKey</td><td>the user NKey public key. </td></tr>
<tr><td class="paramname">sigCB</td><td>the callback to invoke to sign the server nonce. </td></tr>
<tr><td class="paramname">sigClosure</td><td>the closure that will be passed to the <code>sigCB</code> callback. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga696f02e0493c00d3c1eafff45b62b68e" name="ga696f02e0493c00d3c1eafff45b62b68e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga696f02e0493c00d3c1eafff45b62b68e">&#9670;&#160;</a></span>natsOptions_SetNKeyFromSeed()</h2>
<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> natsOptions_SetNKeyFromSeed </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>pubKey</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>seedFile</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Any time the library creates a TCP connection to the server, the server in response sends an <code>INFO</code> protocol. That <code>INFO</code> protocol, for NATS Server at v2.0.0+, may include a <code>nonce</code> for the client to sign.</p>
<p>If this option is set, the library will add the NKey public key <code>pubKey</code> to the <code>CONNECT</code> protocol along with the server's nonce signature signed using the private key from the provided seed file. The library takes care of clearing the memory holding the private key read from the file as soon as it is no longer needed.</p>
<dl class="section note"><dt>Note</dt><dd><a class="el" href="group__opts_group.html#ga696f02e0493c00d3c1eafff45b62b68e" title="Sets the NKey public key and its seed file.">natsOptions_SetNKeyFromSeed()</a> and <a class="el" href="group__opts_group.html#ga60117450fc1f7b6f81bab455aeed7515" title="Sets the callbacks to fetch user JWT and sign server&#39;s nonce.">natsOptions_SetUserCredentialsCallbacks()</a> or <a class="el" href="group__opts_group.html#ga59b47f7b7a19085cf8eaada9bfe5606e" title="Sets the file(s) to use to fetch user JWT and seed required to sign nonce.">natsOptions_SetUserCredentialsFromFiles()</a> are mutually exclusive. Calling this function will remove the user JWT callback and replace the signature handler, that was set with one of the user credentials options, with this one.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__callbacks_group.html#gab786ffd670c86de0563559351305080b" title="Callback used to sign a nonce sent by the server.">natsSignatureHandler</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">pubKey</td><td>the user NKey public key. </td></tr>
<tr><td class="paramname">seedFile</td><td>the name of the file containing the user NKey seed. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gaafda5fb8d9ee3a17bd475ceaecfac218" name="gaafda5fb8d9ee3a17bd475ceaecfac218"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaafda5fb8d9ee3a17bd475ceaecfac218">&#9670;&#160;</a></span>natsOptions_SetWriteDeadline()</h2>
<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> natsOptions_SetWriteDeadline </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int64_t&#160;</td>
<td class="paramname"><em>deadline</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>If this is set, the socket is set to non-blocking mode and write will have a deadline set. If the deadline is reached, the write call will return an error which will translate to publish calls, or any library call trying to send data to the server, to possibly fail.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">deadline</td><td>the write deadline expressed in milliseconds. If set to 0, it means that there is no deadline and socket is in blocking mode. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga192465163abb87ad48a843b45cdf9984" name="ga192465163abb87ad48a843b45cdf9984"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga192465163abb87ad48a843b45cdf9984">&#9670;&#160;</a></span>natsOptions_DisableNoResponders()</h2>
<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> natsOptions_DisableNoResponders </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>disabled</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>By default, when a connection to a NATS Server v2.2.0+ is made, the library signals to the server that it supports the "no responders" feature, which means that if a request is made, and there are no subscriptions on the request subject (no responders), then the server sends back an empty message with the header "Status" and value "503". The request APIs capture this message and instead return a <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80aab97324e40ccfe1360080c651c330e62" title="No responders were running when the server received the request.">NATS_NO_RESPONDERS</a> status, instead of waiting for the timeout to occur and return <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80ab88994c9ea9889ac4d9d656d62f550ed">NATS_TIMEOUT</a>.</p>
<p>In case where users set up their own asynchronous subscription on the reply subject and publish the request with <a class="el" href="group__conn_pub_group.html#gaaaa3d75ffec2dcdc6bf905cdb1eee59e" title="Publishes data on a subject expecting replies on the given reply.">natsConnection_PublishRequest</a> and the like, then the message callback may be invoked with this "no responders" message, which can be checked with <a class="el" href="group__msg_group.html#ga43aa4a8e4b93725b4876ee2677e19c7b" title="Indicates if this message is a &quot;no responders&quot; message from the server.">natsMsg_IsNoResponders</a>.</p>
<p>However, if users don't want to have to deal with that, it is possible to instruct the server to disable this feature for a given connection. If that is the case, requests will behave as with pre-v2.2.0 servers, in that the request will timeout when there are no responders.</p>
<dl class="section note"><dt>Note</dt><dd>This function is to disable the feature that is normally enabled by default. Passing <code>false</code> means that it would enable it again if you had previously disable the option. However, the feature may still be disabled when connecting to a server that does not support it.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__msg_group.html#ga43aa4a8e4b93725b4876ee2677e19c7b" title="Indicates if this message is a &quot;no responders&quot; message from the server.">natsMsg_IsNoResponders()</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">disabled</td><td>the boolean to indicate if the feature should be disabled or not. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gac5173473a731a4a36d15346fedddf91f" name="gac5173473a731a4a36d15346fedddf91f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac5173473a731a4a36d15346fedddf91f">&#9670;&#160;</a></span>natsOptions_SetCustomInboxPrefix()</h2>
<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> natsOptions_SetCustomInboxPrefix </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>inboxPrefix</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>The default inbox prefix is "_INBOX", but you can change it using this option. This can be useful when setting permissions and/or with import/exports across different accounts.</p>
<p>The prefix must be a valid subject and not contain any of the wildcards tokens <code>*</code> nor <code>&gt;</code>.</p>
<p>To clear the custom inbox prefix, call this function with <code>NULL</code> or the empty string.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">inboxPrefix</td><td>the desired inbox prefix. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga5acd292cdaeb63d3d7bd9bbc05513c8f" name="ga5acd292cdaeb63d3d7bd9bbc05513c8f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5acd292cdaeb63d3d7bd9bbc05513c8f">&#9670;&#160;</a></span>natsOptions_SetMessageBufferPadding()</h2>
<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> natsOptions_SetMessageBufferPadding </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>paddingSize</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>By default library allocates natsMsg with payload buffer size equal to payload size. Sometimes it can be useful to add some padding to the end of the buffer which can be tweaked using this option.</p>
<p>To clear the custom message buffer padding, call this function with 0. Changing this option has no effect on existing NATS connections.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object. </td></tr>
<tr><td class="paramname">paddingSize</td><td>the desired inbox prefix. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga93d8068cd6fff53b7f8e1c403db45eb9" name="ga93d8068cd6fff53b7f8e1c403db45eb9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga93d8068cd6fff53b7f8e1c403db45eb9">&#9670;&#160;</a></span>natsOptions_Destroy()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void natsOptions_Destroy </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Destroys the natsOptions object, freeing used memory. See the note in the <a class="el" href="group__opts_group.html#ga61d4a0cf2fbf7d13cc910e5a00c575be" title="Creates a natsOptions object.">natsOptions_Create()</a> call.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> object to destroy. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">NATS.IO Supported By Synadia Communications Inc.
<a href="http://www.nats.io">
</a></li>
</ul>
</div>
</body>
</html>