<trclass="memdesc:gaff52a1ce90253b4bdbb0005fca4f71b6"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Creates a <aclass="el"href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1"title="Way to configure a stanConnection.">stanConnOptions</a> object. <br/></td></tr>
<trclass="memdesc:ga3c6d511fc1e1febcdf5344960de5a0b3"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the URL to connect to. <br/></td></tr>
<trclass="memdesc:gae3fc9a4daa7f85367811a313857337b4"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the NATS Options to use to create the connection. <br/></td></tr>
<trclass="memdesc:ga66c72c482696d9ceca71fced7cbb1264"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the timeout for establishing a connection. <br/></td></tr>
<trclass="memdesc:ga36f2ee441562dcf619d6e020b823fc96"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the timeout for waiting for an ACK for a published message. <br/></td></tr>
<trclass="memdesc:ga07105d1d00878bba19f47243b2c88402"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the subject prefix the library sends the connect request to. <br/></td></tr>
<trclass="memdesc:ga29eee1be7eff749aeac3bab60d1b0405"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the maximum number of published messages without outstanding ACKs from the server. <br/></td></tr>
<trclass="memitem:gad835223f08fbeae2a3c7a34d3fa1550b"id="r_gad835223f08fbeae2a3c7a34d3fa1550b"><tdclass="memItemLeft"align="right"valign="top"><aclass="el"href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a><aclass="el"href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="group__stan_conn_opts_group.html#gad835223f08fbeae2a3c7a34d3fa1550b">stanConnOptions_SetPings</a> (<aclass="el"href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1">stanConnOptions</a> *opts, int interval, int maxOut)</td></tr>
<trclass="memdesc:gad835223f08fbeae2a3c7a34d3fa1550b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the ping interval and max out values. <br/></td></tr>
<trclass="memdesc:ga19ba15c8001aa835b261eea3a309e6d3"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the connection lost handler. <br/></td></tr>
<trclass="memdesc:ga83fd0a29b136cbfb643be642eb2fa726"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Destroys a <aclass="el"href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1"title="Way to configure a stanConnection.">stanConnOptions</a> object. <br/></td></tr>
<p>Creates a <aclass="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 <aclass="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 <aclass="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>
<dlclass="section note"><dt>Note</dt><dd>The object needs to be destroyed when no longer needed.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="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>
<aclass="el"href="group__stan_conn_opts_group.html#ga83fd0a29b136cbfb643be642eb2fa726"title="Destroys a stanConnOptions object.">stanConnOptions_Destroy()</a></dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">newOpts</td><td>the location where store the pointer to the newly created <aclass="el"href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1"title="Way to configure a stanConnection.">stanConnOptions</a> object. </td></tr>
<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>
<dlclass="section note"><dt>Note</dt><dd>This option takes precedence over <aclass="el"href="group__opts_group.html#ga3f7e760214417c7d87541ecb9ab5bea5"title="Sets the URL to connect to.">natsOptions_SetURL</a> when NATS options are passed with <aclass="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>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">opts</td><td>the pointer to the <aclass="el"href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1"title="Way to configure a stanConnection.">stanConnOptions</a> object. </td></tr>
<tr><tdclass="paramname">url</td><td>the string representing the URL the connection should use to connect to the server. </td></tr>
<p>The Streaming client connects to the NATS Streaming Server through a regular NATS Connection (<aclass="el"href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec"title="A connection to a NATS Server.">natsConnection</a>). To configure this connection create a <aclass="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 <aclass="el"href="group__types_group.html#gabcc48b40a81fe302188f4ee06ea9c54e"title="Way to configure a natsConnection.">natsOptions</a> will not affect the <aclass="el"href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1"title="Way to configure a stanConnection.">stanConnOptions</a>.</p>
<dlclass="section note"><dt>Note</dt><dd>If both <aclass="el"href="group__opts_group.html#ga3f7e760214417c7d87541ecb9ab5bea5"title="Sets the URL to connect to.">natsOptions_SetURL</a> and <aclass="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>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">opts</td><td>the pointer to the <aclass="el"href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1"title="Way to configure a stanConnection.">stanConnOptions</a> object. </td></tr>
<tr><tdclass="paramname">nOpts</td><td>the pointer to the <aclass="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>
<tr><tdclass="paramname">opts</td><td>the pointer to the <aclass="el"href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1"title="Way to configure a stanConnection.">stanConnOptions</a> object. </td></tr>
<tr><tdclass="paramname">wait</td><td>how long to wait for a response from the streaming server. </td></tr>
<p>Default is 30000 milliseconds (30 seconds).</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">opts</td><td>the pointer to the <aclass="el"href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1"title="Way to configure a stanConnection.">stanConnOptions</a> object. </td></tr>
<tr><tdclass="paramname">wait</td><td>how long to wait for a response from the streaming server. </td></tr>
<tr><tdclass="paramname">opts</td><td>the pointer to the <aclass="el"href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1"title="Way to configure a stanConnection.">stanConnOptions</a> object. </td></tr>
<tr><tdclass="paramname">prefix</td><td>the subject prefix the library sends the connect request to. </td></tr>
<p>A connection will block <aclass="el"href="group__stan_conn_pub_group.html#ga24f3f7f709b15fe53e1edaeead08fc7d"title="Publishes data on a channel.">stanConnection_Publish()</a> or <aclass="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>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">opts</td><td>the pointer to the <aclass="el"href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1"title="Way to configure a stanConnection.">stanConnOptions</a> object. </td></tr>
<tr><tdclass="paramname">maxPubAcksInflight</td><td>the maximum number of published messages without ACKs from the server. </td></tr>
<tr><tdclass="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>
<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>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">opts</td><td>the pointer to the <aclass="el"href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1"title="Way to configure a stanConnection.">stanConnOptions</a> object. </td></tr>
<tr><tdclass="paramname">interval</td><td>the number of seconds between each PING. </td></tr>
<tr><tdclass="paramname">maxOut</td><td>the maximum number of PINGs without receiving a PONG back. </td></tr>
<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 <aclass="el"href="group__stan_conn_mgt_group.html#ga4952a7f65a53fdb5ca1c26b1a1656f1d"title="Closes the connection.">stanConnection_Close()</a>.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">opts</td><td>the pointer to the <aclass="el"href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1"title="Way to configure a stanConnection.">stanConnOptions</a> object. </td></tr>
<tr><tdclass="paramname">handler</td><td>the handler to be invoked when the connection to the streaming server is lost. </td></tr>
<tr><tdclass="paramname">closure</td><td>the closure the library will pass to the callback. </td></tr>
<p>Destroys the <aclass="el"href="group__types_group.html#ga13d64411878ba13a6ca39c915f2447c1"title="Way to configure a stanConnection.">stanConnOptions</a> object, freeing used memory. See the note in the <aclass="el"href="group__stan_conn_opts_group.html#gaff52a1ce90253b4bdbb0005fca4f71b6"title="Creates a stanConnOptions object.">stanConnOptions_Create()</a> call.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">opts</td><td>the pointer to the <aclass="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 -->
<divid="nav-path"class="navpath"><!-- id is needed for treeview function! -->
<ul>
<liclass="footer">NATS.IO Supported By Synadia Communications Inc.