<trclass="memdesc:gac0b9f7759ecc39b8d77807b94254f9b4"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Publishes data on a subject. <br/></td></tr>
<trclass="memdesc:gad09a717c20de4cf0e2a21dcfd9ce6c64"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Publishes a string on a subject. <br/></td></tr>
<trclass="memdesc:ga74511acd87385931112c45c48c2a14ba"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Publishes a message on a subject. <br/></td></tr>
<trclass="memdesc:gaaaa3d75ffec2dcdc6bf905cdb1eee59e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Publishes data on a subject expecting replies on the given reply. <br/></td></tr>
<trclass="memdesc:gaafca9a8294e81a5a9979e762931e56c5"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Publishes a string on a subject expecting replies on the given reply. <br/></td></tr>
<trclass="memdesc:gaf4b4a022f9c21fc269b87c000330c5a7"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sends a request and waits for a reply. <br/></td></tr>
<trclass="memdesc:ga4bb5105df6a3efd2088e6be0fdf6b31f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sends a request (as a string) and waits for a reply. <br/></td></tr>
<trclass="memdesc:ga052de4b75b3b69ccd8d20eb4861b801d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sends a request based on the given <code>requestMsg</code> and waits for a reply. <br/></td></tr>
<p>Publishes the data argument to the given subject. The data argument is left untouched and needs to be correctly interpreted on the receiver.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">nc</td><td>the pointer to the <aclass="el"href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec"title="A connection to a NATS Server.">natsConnection</a> object. </td></tr>
<tr><tdclass="paramname">subj</td><td>the subject the data is sent to. </td></tr>
<tr><tdclass="paramname">data</td><td>the data to be sent, can be <code>NULL</code>. </td></tr>
<tr><tdclass="paramname">dataLen</td><td>the length of the data to be sent. </td></tr>
<divclass="ttc"id="agroup__conn_pub_group_html_gac0b9f7759ecc39b8d77807b94254f9b4"><divclass="ttname"><ahref="group__conn_pub_group.html#gac0b9f7759ecc39b8d77807b94254f9b4">natsConnection_Publish</a></div><divclass="ttdeci">NATS_EXTERN natsStatus natsConnection_Publish(natsConnection *nc, const char *subj, const void *data, int dataLen)</div><divclass="ttdoc">Publishes data on a subject.</div></div>
</div><!-- fragment --><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">nc</td><td>the pointer to the <aclass="el"href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec"title="A connection to a NATS Server.">natsConnection</a> object. </td></tr>
<tr><tdclass="paramname">subj</td><td>the subject the data is sent to. </td></tr>
<tr><tdclass="paramname">str</td><td>the string to be sent. </td></tr>
<p>Publishes the <aclass="el"href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a"title="A structure holding a subject, optional reply and payload.">natsMsg</a>, which includes the subject, an optional reply and optional data.</p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="group__msg_group.html#ga098e4fec1c5a71c00a0d092fbd6d1a21"title="Creates a natsMsg object.">natsMsg_Create()</a></dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">nc</td><td>the pointer to the <aclass="el"href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec"title="A connection to a NATS Server.">natsConnection</a> object. </td></tr>
<tr><tdclass="paramname">msg</td><td>the pointer to the <aclass="el"href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a"title="A structure holding a subject, optional reply and payload.">natsMsg</a> object to send. </td></tr>
<p>Publishes the data argument to the given subject expecting a response on the reply subject. Use <aclass="el"href="group__conn_pub_group.html#gaf4b4a022f9c21fc269b87c000330c5a7"title="Sends a request and waits for a reply.">natsConnection_Request()</a> for automatically waiting for a response inline.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">nc</td><td>the pointer to the <aclass="el"href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec"title="A connection to a NATS Server.">natsConnection</a> object. </td></tr>
<tr><tdclass="paramname">subj</td><td>the subject the request is sent to. </td></tr>
<tr><tdclass="paramname">reply</td><td>the reply on which resonses are expected. </td></tr>
<tr><tdclass="paramname">data</td><td>the data to be sent, can be <code>NULL</code>. </td></tr>
<tr><tdclass="paramname">dataLen</td><td>the length of the data to be sent. </td></tr>
</div><!-- fragment --><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">nc</td><td>the pointer to the <aclass="el"href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec"title="A connection to a NATS Server.">natsConnection</a> object. </td></tr>
<tr><tdclass="paramname">subj</td><td>the subject the request is sent to. </td></tr>
<tr><tdclass="paramname">reply</td><td>the reply on which resonses are expected. </td></tr>
<tr><tdclass="paramname">str</td><td>the string to send. </td></tr>
<p>Sends a request payload and delivers the first response message, or an error, including a timeout if no message was received properly.</p>
<dlclass="section warning"><dt>Warning</dt><dd>If connected to a NATS Server v2.2.0+ with no responder running when the request is received, this call will return a <aclass="el"href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80aab97324e40ccfe1360080c651c330e62"title="No responders were running when the server received the request.">NATS_NO_RESPONDERS</a> error.</dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">replyMsg</td><td>the location where to store the pointer to the received <aclass="el"href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a"title="A structure holding a subject, optional reply and payload.">natsMsg</a> reply. </td></tr>
<tr><tdclass="paramname">nc</td><td>the pointer to the <aclass="el"href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec"title="A connection to a NATS Server.">natsConnection</a> object. </td></tr>
<tr><tdclass="paramname">subj</td><td>the subject the request is sent to. </td></tr>
<tr><tdclass="paramname">data</td><td>the data of the request, can be <code>NULL</code>. </td></tr>
<tr><tdclass="paramname">dataLen</td><td>the length of the data to send. </td></tr>
<tr><tdclass="paramname">timeout</td><td>in milliseconds, before this call returns <aclass="el"href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80ab88994c9ea9889ac4d9d656d62f550ed">NATS_TIMEOUT</a> if no response is received in this alloted time. </td></tr>
<divclass="ttc"id="agroup__conn_pub_group_html_gaf4b4a022f9c21fc269b87c000330c5a7"><divclass="ttname"><ahref="group__conn_pub_group.html#gaf4b4a022f9c21fc269b87c000330c5a7">natsConnection_Request</a></div><divclass="ttdeci">NATS_EXTERN natsStatus natsConnection_Request(natsMsg **replyMsg, natsConnection *nc, const char *subj, const void *data, int dataLen, int64_t timeout)</div><divclass="ttdoc">Sends a request and waits for a reply.</div></div>
</div><!-- fragment --><dlclass="section warning"><dt>Warning</dt><dd>See warning about no responders in <aclass="el"href="group__conn_pub_group.html#gaf4b4a022f9c21fc269b87c000330c5a7"title="Sends a request and waits for a reply.">natsConnection_Request()</a>.</dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">replyMsg</td><td>the location where to store the pointer to the received <aclass="el"href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a"title="A structure holding a subject, optional reply and payload.">natsMsg</a> reply. </td></tr>
<tr><tdclass="paramname">nc</td><td>the pointer to the <aclass="el"href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec"title="A connection to a NATS Server.">natsConnection</a> object. </td></tr>
<tr><tdclass="paramname">subj</td><td>the subject the request is sent to. </td></tr>
<tr><tdclass="paramname">str</td><td>the string to send. </td></tr>
<tr><tdclass="paramname">timeout</td><td>in milliseconds, before this call returns <aclass="el"href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80ab88994c9ea9889ac4d9d656d62f550ed">NATS_TIMEOUT</a> if no response is received in this alloted time. </td></tr>
<p>Similar to <aclass="el"href="group__conn_pub_group.html#gaf4b4a022f9c21fc269b87c000330c5a7"title="Sends a request and waits for a reply.">natsConnection_Request</a> but uses <code>requestMsg</code> to extract subject, and payload to send.</p>
<dlclass="section warning"><dt>Warning</dt><dd>See warning about no responders in <aclass="el"href="group__conn_pub_group.html#gaf4b4a022f9c21fc269b87c000330c5a7"title="Sends a request and waits for a reply.">natsConnection_Request()</a>.</dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">replyMsg</td><td>the location where to store the pointer to the received <aclass="el"href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a"title="A structure holding a subject, optional reply and payload.">natsMsg</a> reply. </td></tr>
<tr><tdclass="paramname">nc</td><td>the pointer to the <aclass="el"href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec"title="A connection to a NATS Server.">natsConnection</a> object. </td></tr>
<tr><tdclass="paramname">requestMsg</td><td>the message used for the request. </td></tr>
<tr><tdclass="paramname">timeout</td><td>in milliseconds, before this call returns <aclass="el"href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80ab88994c9ea9889ac4d9d656d62f550ed">NATS_TIMEOUT</a> if no response is received in this alloted time. </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.