nats.zig/deps/nats.c/doc/html/group__stan_conn_opts_group.html
torque 41fbdf886b
git subrepo pull --branch=v3.7.0 deps/nats.c
subrepo:
  subdir:   "deps/nats.c"
  merged:   "5d057f6"
upstream:
  origin:   "https://github.com/nats-io/nats.c.git"
  branch:   "v3.7.0"
  commit:   "5d057f6"
git-subrepo:
  version:  "0.4.6"
  commit:   "affc4c01a"
2023-10-14 13:22:13 -07:00

529 lines
36 KiB
HTML

<!-- 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: Streaming Connection 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__stan_conn_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">Streaming Connection 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:gaff52a1ce90253b4bdbb0005fca4f71b6" id="r_gaff52a1ce90253b4bdbb0005fca4f71b6"><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__stan_conn_opts_group.html#gaff52a1ce90253b4bdbb0005fca4f71b6">stanConnOptions_Create</a> (<a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</a> **newOpts)</td></tr>
<tr class="memdesc:gaff52a1ce90253b4bdbb0005fca4f71b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a <a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1" title="Way to configure a stanConnection.">stanConnOptions</a> object. <br /></td></tr>
<tr class="separator:gaff52a1ce90253b4bdbb0005fca4f71b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3c6d511fc1e1febcdf5344960de5a0b3" id="r_ga3c6d511fc1e1febcdf5344960de5a0b3"><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__stan_conn_opts_group.html#ga3c6d511fc1e1febcdf5344960de5a0b3">stanConnOptions_SetURL</a> (<a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</a> *opts, const char *url)</td></tr>
<tr class="memdesc:ga3c6d511fc1e1febcdf5344960de5a0b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the URL to connect to. <br /></td></tr>
<tr class="separator:ga3c6d511fc1e1febcdf5344960de5a0b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae3fc9a4daa7f85367811a313857337b4" id="r_gae3fc9a4daa7f85367811a313857337b4"><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__stan_conn_opts_group.html#gae3fc9a4daa7f85367811a313857337b4">stanConnOptions_SetNATSOptions</a> (<a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</a> *opts, <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *nOpts)</td></tr>
<tr class="memdesc:gae3fc9a4daa7f85367811a313857337b4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the NATS Options to use to create the connection. <br /></td></tr>
<tr class="separator:gae3fc9a4daa7f85367811a313857337b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga66c72c482696d9ceca71fced7cbb1264" id="r_ga66c72c482696d9ceca71fced7cbb1264"><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__stan_conn_opts_group.html#ga66c72c482696d9ceca71fced7cbb1264">stanConnOptions_SetConnectionWait</a> (<a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</a> *opts, int64_t wait)</td></tr>
<tr class="memdesc:ga66c72c482696d9ceca71fced7cbb1264"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the timeout for establishing a connection. <br /></td></tr>
<tr class="separator:ga66c72c482696d9ceca71fced7cbb1264"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga36f2ee441562dcf619d6e020b823fc96" id="r_ga36f2ee441562dcf619d6e020b823fc96"><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__stan_conn_opts_group.html#ga36f2ee441562dcf619d6e020b823fc96">stanConnOptions_SetPubAckWait</a> (<a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</a> *opts, int64_t wait)</td></tr>
<tr class="memdesc:ga36f2ee441562dcf619d6e020b823fc96"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the timeout for waiting for an ACK for a published message. <br /></td></tr>
<tr class="separator:ga36f2ee441562dcf619d6e020b823fc96"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga07105d1d00878bba19f47243b2c88402" id="r_ga07105d1d00878bba19f47243b2c88402"><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__stan_conn_opts_group.html#ga07105d1d00878bba19f47243b2c88402">stanConnOptions_SetDiscoveryPrefix</a> (<a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</a> *opts, const char *prefix)</td></tr>
<tr class="memdesc:ga07105d1d00878bba19f47243b2c88402"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the subject prefix the library sends the connect request to. <br /></td></tr>
<tr class="separator:ga07105d1d00878bba19f47243b2c88402"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga29eee1be7eff749aeac3bab60d1b0405" id="r_ga29eee1be7eff749aeac3bab60d1b0405"><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__stan_conn_opts_group.html#ga29eee1be7eff749aeac3bab60d1b0405">stanConnOptions_SetMaxPubAcksInflight</a> (<a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</a> *opts, int maxPubAcksInflight, float percentage)</td></tr>
<tr class="memdesc:ga29eee1be7eff749aeac3bab60d1b0405"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the maximum number of published messages without outstanding ACKs from the server. <br /></td></tr>
<tr class="separator:ga29eee1be7eff749aeac3bab60d1b0405"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad835223f08fbeae2a3c7a34d3fa1550b" id="r_gad835223f08fbeae2a3c7a34d3fa1550b"><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__stan_conn_opts_group.html#gad835223f08fbeae2a3c7a34d3fa1550b">stanConnOptions_SetPings</a> (<a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</a> *opts, int interval, int maxOut)</td></tr>
<tr class="memdesc:gad835223f08fbeae2a3c7a34d3fa1550b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the ping interval and max out values. <br /></td></tr>
<tr class="separator:gad835223f08fbeae2a3c7a34d3fa1550b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga19ba15c8001aa835b261eea3a309e6d3" id="r_ga19ba15c8001aa835b261eea3a309e6d3"><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__stan_conn_opts_group.html#ga19ba15c8001aa835b261eea3a309e6d3">stanConnOptions_SetConnectionLostHandler</a> (<a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</a> *opts, <a class="el" href="group__callbacks_group.html#gac34092f6c698374f86ad349302bdd55c">stanConnectionLostHandler</a> handler, void *closure)</td></tr>
<tr class="memdesc:ga19ba15c8001aa835b261eea3a309e6d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the connection lost handler. <br /></td></tr>
<tr class="separator:ga19ba15c8001aa835b261eea3a309e6d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga83fd0a29b136cbfb643be642eb2fa726" id="r_ga83fd0a29b136cbfb643be642eb2fa726"><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__stan_conn_opts_group.html#ga83fd0a29b136cbfb643be642eb2fa726">stanConnOptions_Destroy</a> (<a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</a> *opts)</td></tr>
<tr class="memdesc:ga83fd0a29b136cbfb643be642eb2fa726"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys a <a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1" title="Way to configure a stanConnection.">stanConnOptions</a> object. <br /></td></tr>
<tr class="separator:ga83fd0a29b136cbfb643be642eb2fa726"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>NATS Streaming Connection Options. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaff52a1ce90253b4bdbb0005fca4f71b6" name="gaff52a1ce90253b4bdbb0005fca4f71b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaff52a1ce90253b4bdbb0005fca4f71b6">&#9670;&#160;</a></span>stanConnOptions_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> stanConnOptions_Create </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</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#ga13d64411878ba13a6ca39c915f2447c1" title="Way to configure a stanConnection.">stanConnOptions</a> object. This object is used when one wants to set specific options prior to connecting to the <code>NATS Streaning Server</code>.</p>
<p>After making the appropriate <code>stanConnOptions_SetXXX()</code> calls, this object is passed to the <a class="el" href="group__stan_conn_mgt_group.html#ga35e0e6e5e3b7f3818a3ac3600efb8f8f" title="Connects to a NATS Streaming Server using the provided options.">stanConnection_Connect()</a> call, which will clone this object. After <a class="el" href="group__stan_conn_mgt_group.html#ga35e0e6e5e3b7f3818a3ac3600efb8f8f" title="Connects to a NATS Streaming Server using the provided options.">stanConnection_Connect()</a> returns, modifications to the options object will not affect the connection.</p>
<p>The default options set in this call are: url: <code>nats://localhost:4222</code> connection wait: 2 seconds publish ack wait: 30 seconds discovery prefix: <code>_STAN.discovery</code> maximum publish acks inflight and percentage: 16384, 50% ping interval: 5 seconds max ping out without response: 3</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__stan_conn_mgt_group.html#ga35e0e6e5e3b7f3818a3ac3600efb8f8f" title="Connects to a NATS Streaming Server using the provided options.">stanConnection_Connect()</a> </dd>
<dd>
<a class="el" href="group__stan_conn_opts_group.html#ga83fd0a29b136cbfb643be642eb2fa726" title="Destroys a stanConnOptions object.">stanConnOptions_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#ga13d64411878ba13a6ca39c915f2447c1" title="Way to configure a stanConnection.">stanConnOptions</a> object. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga3c6d511fc1e1febcdf5344960de5a0b3" name="ga3c6d511fc1e1febcdf5344960de5a0b3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3c6d511fc1e1febcdf5344960de5a0b3">&#9670;&#160;</a></span>stanConnOptions_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> stanConnOptions_SetURL </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</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 Streaming Server</code> the client should try to connect to. The URL can contain optional user name and password. You can provide a comma separated list of URLs too.</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>
<li>nats://host1:4222,nats://host2:4222,nats://host3:4222</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>This option takes precedence over <a class="el" href="group__opts_group.html#ga3f7e760214417c7d87541ecb9ab5bea5" title="Sets the URL to connect to.">natsOptions_SetURL</a> when NATS options are passed with <a class="el" href="group__stan_conn_opts_group.html#gae3fc9a4daa7f85367811a313857337b4" title="Sets the NATS Options to use to create the connection.">stanConnOptions_SetNATSOptions</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#ga13d64411878ba13a6ca39c915f2447c1" title="Way to configure a stanConnection.">stanConnOptions</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="gae3fc9a4daa7f85367811a313857337b4" name="gae3fc9a4daa7f85367811a313857337b4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae3fc9a4daa7f85367811a313857337b4">&#9670;&#160;</a></span>stanConnOptions_SetNATSOptions()</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> stanConnOptions_SetNATSOptions </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</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__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e">natsOptions</a> *&#160;</td>
<td class="paramname"><em>nOpts</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>The Streaming client connects to the NATS Streaming Server through a regular NATS Connection (<a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec" title="A connection to a NATS Server.">natsConnection</a>). To configure this connection create a <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> and configure it as needed, then call this function.</p>
<p>This function clones the passed options, so after this call, any changes to the given <a class="el" href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e" title="Way to configure a natsConnection.">natsOptions</a> will not affect the <a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1" title="Way to configure a stanConnection.">stanConnOptions</a>.</p>
<dl class="section note"><dt>Note</dt><dd>If both <a class="el" href="group__opts_group.html#ga3f7e760214417c7d87541ecb9ab5bea5" title="Sets the URL to connect to.">natsOptions_SetURL</a> and <a class="el" href="group__stan_conn_opts_group.html#ga3c6d511fc1e1febcdf5344960de5a0b3" title="Sets the URL to connect to.">stanConnOptions_SetURL</a> are used the URL(s) set in the later take precedence.</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#ga13d64411878ba13a6ca39c915f2447c1" title="Way to configure a stanConnection.">stanConnOptions</a> object. </td></tr>
<tr><td class="paramname">nOpts</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 use to create the connection to the server. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga66c72c482696d9ceca71fced7cbb1264" name="ga66c72c482696d9ceca71fced7cbb1264"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga66c72c482696d9ceca71fced7cbb1264">&#9670;&#160;</a></span>stanConnOptions_SetConnectionWait()</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> stanConnOptions_SetConnectionWait </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</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>wait</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Value expressed in milliseconds.</p>
<p>Default is 2000 milliseconds (2 seconds).</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#ga13d64411878ba13a6ca39c915f2447c1" title="Way to configure a stanConnection.">stanConnOptions</a> object. </td></tr>
<tr><td class="paramname">wait</td><td>how long to wait for a response from the streaming server. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga36f2ee441562dcf619d6e020b823fc96" name="ga36f2ee441562dcf619d6e020b823fc96"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga36f2ee441562dcf619d6e020b823fc96">&#9670;&#160;</a></span>stanConnOptions_SetPubAckWait()</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> stanConnOptions_SetPubAckWait </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</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>wait</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Value expressed in milliseconds.</p>
<p>Default is 30000 milliseconds (30 seconds).</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#ga13d64411878ba13a6ca39c915f2447c1" title="Way to configure a stanConnection.">stanConnOptions</a> object. </td></tr>
<tr><td class="paramname">wait</td><td>how long to wait for a response from the streaming server. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga07105d1d00878bba19f47243b2c88402" name="ga07105d1d00878bba19f47243b2c88402"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga07105d1d00878bba19f47243b2c88402">&#9670;&#160;</a></span>stanConnOptions_SetDiscoveryPrefix()</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> stanConnOptions_SetDiscoveryPrefix </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</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>prefix</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Default is <code>_STAN.discovery</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#ga13d64411878ba13a6ca39c915f2447c1" title="Way to configure a stanConnection.">stanConnOptions</a> object. </td></tr>
<tr><td class="paramname">prefix</td><td>the subject prefix the library sends the connect request to. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga29eee1be7eff749aeac3bab60d1b0405" name="ga29eee1be7eff749aeac3bab60d1b0405"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga29eee1be7eff749aeac3bab60d1b0405">&#9670;&#160;</a></span>stanConnOptions_SetMaxPubAcksInflight()</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> stanConnOptions_SetMaxPubAcksInflight </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</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>maxPubAcksInflight</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>percentage</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>A connection will block <a class="el" href="group__stan_conn_pub_group.html#ga24f3f7f709b15fe53e1edaeead08fc7d" title="Publishes data on a channel.">stanConnection_Publish()</a> or <a class="el" href="group__stan_conn_pub_group.html#ga0c4d1e4615f8ac834f0a4021f75d39f0" title="Asynchronously publishes data on a channel.">stanConnection_PublishAsync</a> calls if the number of outstanding published messages has reached this number.</p>
<p>When the connection receives ACKs, the number of outstanding messages will decrease. If the number falls between <code>maxPubAcksInflight * percentage</code>, then the blocked publish calls will be released.</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#ga13d64411878ba13a6ca39c915f2447c1" title="Way to configure a stanConnection.">stanConnOptions</a> object. </td></tr>
<tr><td class="paramname">maxPubAcksInflight</td><td>the maximum number of published messages without ACKs from the server. </td></tr>
<tr><td class="paramname">percentage</td><td>the percentage (expressed as a float between ]0.0 and 1.0]) of the maxPubAcksInflight number below which a blocked publish call is released. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gad835223f08fbeae2a3c7a34d3fa1550b" name="gad835223f08fbeae2a3c7a34d3fa1550b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad835223f08fbeae2a3c7a34d3fa1550b">&#9670;&#160;</a></span>stanConnOptions_SetPings()</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> stanConnOptions_SetPings </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</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>interval</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>maxOut</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Value expressed in number of seconds.</p>
<p>Default is 5 seconds and 3 missed PONGs.</p>
<p>The interval needs to be at least 1 and represents the number of seconds. The maxOut needs to be at least 2, since the count of sent PINGs increase whenever a PING is sent and reset to 0 when a response is received. Setting to 1 would cause the library to close the connection right away.</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#ga13d64411878ba13a6ca39c915f2447c1" title="Way to configure a stanConnection.">stanConnOptions</a> object. </td></tr>
<tr><td class="paramname">interval</td><td>the number of seconds between each PING. </td></tr>
<tr><td class="paramname">maxOut</td><td>the maximum number of PINGs without receiving a PONG back. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga19ba15c8001aa835b261eea3a309e6d3" name="ga19ba15c8001aa835b261eea3a309e6d3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga19ba15c8001aa835b261eea3a309e6d3">&#9670;&#160;</a></span>stanConnOptions_SetConnectionLostHandler()</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> stanConnOptions_SetConnectionLostHandler </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</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#gac34092f6c698374f86ad349302bdd55c">stanConnectionLostHandler</a>&#160;</td>
<td class="paramname"><em>handler</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 will be invoked should the client permanently lose contact with the server (or another client replaces it while being disconnected). The callback will not be invoked on normal <a class="el" href="group__stan_conn_mgt_group.html#ga4952a7f65a53fdb5ca1c26b1a1656f1d" title="Closes the connection.">stanConnection_Close()</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#ga13d64411878ba13a6ca39c915f2447c1" title="Way to configure a stanConnection.">stanConnOptions</a> object. </td></tr>
<tr><td class="paramname">handler</td><td>the handler to be invoked when the connection to the streaming server is lost. </td></tr>
<tr><td class="paramname">closure</td><td>the closure the library will pass to the callback. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga83fd0a29b136cbfb643be642eb2fa726" name="ga83fd0a29b136cbfb643be642eb2fa726"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga83fd0a29b136cbfb643be642eb2fa726">&#9670;&#160;</a></span>stanConnOptions_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 stanConnOptions_Destroy </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</a> *&#160;</td>
<td class="paramname"><em>opts</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Destroys the <a class="el" href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1" title="Way to configure a stanConnection.">stanConnOptions</a> object, freeing used memory. See the note in the <a class="el" href="group__stan_conn_opts_group.html#gaff52a1ce90253b4bdbb0005fca4f71b6" title="Creates a stanConnOptions object.">stanConnOptions_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#ga13d64411878ba13a6ca39c915f2447c1" title="Way to configure a stanConnection.">stanConnOptions</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>