2023-08-15 00:19:51 -07:00
<!-- 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" / >
2023-10-14 12:24:01 -07:00
< meta name = "generator" content = "Doxygen 1.9.8" / >
2023-08-15 00:19:51 -07:00
< title > NATS C Client with JetStream and Streaming support: Publishing< / 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
2023-10-14 12:24:01 -07:00
  < span id = "projectnumber" > 3.7.0< / span >
2023-08-15 00:19:51 -07:00
< / div >
< div id = "projectbrief" > The nats.io C Client, Supported by Synadia Communications Inc.< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
<!-- end header part -->
2023-10-14 12:24:01 -07:00
<!-- Generated by Doxygen 1.9.8 -->
2023-08-15 00:19:51 -07:00
< script type = "text/javascript" >
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699& 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& 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& dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__stan_conn_pub_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" > Publishing< div class = "ingroups" > < a class = "el" href = "group__func_group.html" > Functions< / a > » < a class = "el" href = "group__stan_conn_group.html" > Streaming Connection< / 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 >
2023-10-14 12:24:01 -07:00
< tr class = "memitem:ga24f3f7f709b15fe53e1edaeead08fc7d" id = "r_ga24f3f7f709b15fe53e1edaeead08fc7d" > < 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 >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__stan_conn_pub_group.html#ga24f3f7f709b15fe53e1edaeead08fc7d" > stanConnection_Publish< / a > (< a class = "el" href = "group__types_group.html#ga9e826493769d23086cfccefe95cdf64c" > stanConnection< / a > *sc, const char *channel, const void *data, int dataLen)< / td > < / tr >
2023-08-15 00:19:51 -07:00
< tr class = "memdesc:ga24f3f7f709b15fe53e1edaeead08fc7d" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Publishes data on a channel. < br / > < / td > < / tr >
< tr class = "separator:ga24f3f7f709b15fe53e1edaeead08fc7d" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2023-10-14 12:24:01 -07:00
< tr class = "memitem:ga0c4d1e4615f8ac834f0a4021f75d39f0" id = "r_ga0c4d1e4615f8ac834f0a4021f75d39f0" > < 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 >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__stan_conn_pub_group.html#ga0c4d1e4615f8ac834f0a4021f75d39f0" > stanConnection_PublishAsync< / a > (< a class = "el" href = "group__types_group.html#ga9e826493769d23086cfccefe95cdf64c" > stanConnection< / a > *sc, const char *channel, const void *data, int dataLen, < a class = "el" href = "group__callbacks_group.html#gad5d6a685731b3bf635995b7375af4d18" > stanPubAckHandler< / a > ah, void *ahClosure)< / td > < / tr >
2023-08-15 00:19:51 -07:00
< tr class = "memdesc:ga0c4d1e4615f8ac834f0a4021f75d39f0" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Asynchronously publishes data on a channel. < br / > < / td > < / tr >
< tr class = "separator:ga0c4d1e4615f8ac834f0a4021f75d39f0" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table >
< a name = "details" id = "details" > < / a > < h2 class = "groupheader" > Detailed Description< / h2 >
< p > Publishing functions < / p >
< h2 class = "groupheader" > Function Documentation< / h2 >
< a id = "ga24f3f7f709b15fe53e1edaeead08fc7d" name = "ga24f3f7f709b15fe53e1edaeead08fc7d" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#ga24f3f7f709b15fe53e1edaeead08fc7d" > ◆   < / a > < / span > stanConnection_Publish()< / 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 > stanConnection_Publish < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "group__types_group.html#ga9e826493769d23086cfccefe95cdf64c" > stanConnection< / a > *  < / td >
< td class = "paramname" > < em > sc< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const char *  < / td >
< td class = "paramname" > < em > channel< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const void *  < / td >
< td class = "paramname" > < em > data< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > dataLen< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Publishes the data argument to the given channel. The data argument is left untouched and needs to be correctly interpreted on the receiver.< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramname" > sc< / td > < td > the pointer to the < a class = "el" href = "group__types_group.html#ga9e826493769d23086cfccefe95cdf64c" title = "A connection to a NATS Streaming Server." > stanConnection< / a > object. < / td > < / tr >
< tr > < td class = "paramname" > channel< / td > < td > the channel name the data is sent to. < / td > < / tr >
< tr > < td class = "paramname" > data< / td > < td > the data to be sent, can be < code > NULL< / code > . < / td > < / tr >
< tr > < td class = "paramname" > dataLen< / td > < td > the length of the data to be sent. < / td > < / tr >
< / table >
< / dd >
< / dl >
< / div >
< / div >
< a id = "ga0c4d1e4615f8ac834f0a4021f75d39f0" name = "ga0c4d1e4615f8ac834f0a4021f75d39f0" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#ga0c4d1e4615f8ac834f0a4021f75d39f0" > ◆   < / a > < / span > stanConnection_PublishAsync()< / 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 > stanConnection_PublishAsync < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "group__types_group.html#ga9e826493769d23086cfccefe95cdf64c" > stanConnection< / a > *  < / td >
< td class = "paramname" > < em > sc< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const char *  < / td >
< td class = "paramname" > < em > channel< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const void *  < / td >
< td class = "paramname" > < em > data< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > dataLen< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > < a class = "el" href = "group__callbacks_group.html#gad5d6a685731b3bf635995b7375af4d18" > stanPubAckHandler< / a >   < / td >
< td class = "paramname" > < em > ah< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > void *  < / td >
< td class = "paramname" > < em > ahClosure< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Publishes the data argument to the given channel. The data argument is left untouched and needs to be correctly interpreted on the receiver.< / p >
< p > This function does not wait for an acknowledgment back from the server. Instead, the library will invoke the provided callback when that acknowledgment comes.< / p >
< p > In order to correlate the acknowledgment with the published message, you can use the < code > ahClosure< / code > since this will be passed to the < a class = "el" href = "group__callbacks_group.html#gad5d6a685731b3bf635995b7375af4d18" title = "Callback used to notify of an asynchronous publish result." > stanPubAckHandler< / a > on every invocation. In other words, you should use a unique closure for each published message.< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramname" > sc< / td > < td > the pointer to the < a class = "el" href = "group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec" title = "A connection to a NATS Server." > natsConnection< / a > object. < / td > < / tr >
< tr > < td class = "paramname" > channel< / td > < td > the channel name the data is sent to. < / td > < / tr >
< tr > < td class = "paramname" > data< / td > < td > the data to be sent, can be < code > NULL< / code > . < / td > < / tr >
< tr > < td class = "paramname" > dataLen< / td > < td > the length of the data to be sent. < / td > < / tr >
< tr > < td class = "paramname" > ah< / td > < td > the publish acknowledgment callback. If < code > NULL< / code > the user will not be notified of the publish result. < / td > < / tr >
< tr > < td class = "paramname" > ahClosure< / td > < td > the closure the library will pass to the < code > ah< / code > callback if one has been set. < / 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 >