grpc/cpp/classgrpc_1_1_server_async_...

370 lines
18 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GRPC C++: grpc::ServerAsyncWriter&lt; W &gt; Class Template Reference</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="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="doxygen.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">GRPC C++
&#160;<span id="projectnumber">1.58.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @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:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- 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">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacegrpc.html">grpc</a></li><li class="navelem"><a class="el" href="classgrpc_1_1_server_async_writer.html">ServerAsyncWriter</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">grpc::ServerAsyncWriter&lt; W &gt; Class Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Async server-side API for doing server streaming RPCs, where the outgoing message stream from the server has messages of type <em>W</em>.
<a href="classgrpc_1_1_server_async_writer.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="grpcpp_2server__context_8h_source.html">server_context.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a2c2bc3442e8386029452e4f179dbc508"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc_1_1_server_async_writer.html#a2c2bc3442e8386029452e4f179dbc508">ServerAsyncWriter</a> (<a class="el" href="classgrpc_1_1_server_context.html">grpc::ServerContext</a> *ctx)</td></tr>
<tr class="separator:a2c2bc3442e8386029452e4f179dbc508"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adbefffa0dd7ae810ed1c2bf877d46f96"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc_1_1_server_async_writer.html#adbefffa0dd7ae810ed1c2bf877d46f96">SendInitialMetadata</a> (void *tag) override</td></tr>
<tr class="memdesc:adbefffa0dd7ae810ed1c2bf877d46f96"><td class="mdescLeft">&#160;</td><td class="mdescRight">See <em>ServerAsyncStreamingInterface::SendInitialMetadata</em> for semantics. <a href="classgrpc_1_1_server_async_writer.html#adbefffa0dd7ae810ed1c2bf877d46f96">More...</a><br /></td></tr>
<tr class="separator:adbefffa0dd7ae810ed1c2bf877d46f96"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a467f70c7460ceb7738fb938b3bf93c85"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc_1_1_server_async_writer.html#a467f70c7460ceb7738fb938b3bf93c85">Write</a> (const W &amp;msg, void *tag) override</td></tr>
<tr class="separator:a467f70c7460ceb7738fb938b3bf93c85"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a676fd381559f338580a67654e8247f90"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc_1_1_server_async_writer.html#a676fd381559f338580a67654e8247f90">Write</a> (const W &amp;msg, <a class="el" href="classgrpc_1_1_write_options.html">grpc::WriteOptions</a> options, void *tag) override</td></tr>
<tr class="separator:a676fd381559f338580a67654e8247f90"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a26afb06eab6ba1c4b045aadf9881131a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc_1_1_server_async_writer.html#a26afb06eab6ba1c4b045aadf9881131a">WriteAndFinish</a> (const W &amp;msg, <a class="el" href="classgrpc_1_1_write_options.html">grpc::WriteOptions</a> options, const <a class="el" href="classgrpc_1_1_status.html">grpc::Status</a> &amp;status, void *tag) override</td></tr>
<tr class="memdesc:a26afb06eab6ba1c4b045aadf9881131a"><td class="mdescLeft">&#160;</td><td class="mdescRight">See the <em><a class="el" href="classgrpc_1_1_server_async_writer_interface.html#a7366392b0695df97520394208be1504b" title="Request the writing of msg and coalesce it with trailing metadata which contains status,...">ServerAsyncWriterInterface.WriteAndFinish</a></em> method for semantics. <a href="classgrpc_1_1_server_async_writer.html#a26afb06eab6ba1c4b045aadf9881131a">More...</a><br /></td></tr>
<tr class="separator:a26afb06eab6ba1c4b045aadf9881131a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00c50ee5b2521f11ff96b0b1317980e2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc_1_1_server_async_writer.html#a00c50ee5b2521f11ff96b0b1317980e2">Finish</a> (const <a class="el" href="classgrpc_1_1_status.html">grpc::Status</a> &amp;status, void *tag) override</td></tr>
<tr class="memdesc:a00c50ee5b2521f11ff96b0b1317980e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">See the <em><a class="el" href="classgrpc_1_1_server_async_writer_interface.html#a3055aa0c0b7af061252e198ecad79c74" title="Indicate that the stream is to be finished with a certain status code.">ServerAsyncWriterInterface.Finish</a></em> method for semantics. <a href="classgrpc_1_1_server_async_writer.html#a00c50ee5b2521f11ff96b0b1317980e2">More...</a><br /></td></tr>
<tr class="separator:a00c50ee5b2521f11ff96b0b1317980e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;class W&gt;<br />
class grpc::ServerAsyncWriter&lt; W &gt;</h3>
<p>Async server-side API for doing server streaming RPCs, where the outgoing message stream from the server has messages of type <em>W</em>. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a2c2bc3442e8386029452e4f179dbc508"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2c2bc3442e8386029452e4f179dbc508">&#9670;&nbsp;</a></span>ServerAsyncWriter()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class W &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classgrpc_1_1_server_async_writer.html">grpc::ServerAsyncWriter</a>&lt; W &gt;::<a class="el" href="classgrpc_1_1_server_async_writer.html">ServerAsyncWriter</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classgrpc_1_1_server_context.html">grpc::ServerContext</a> *&#160;</td>
<td class="paramname"><em>ctx</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a00c50ee5b2521f11ff96b0b1317980e2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a00c50ee5b2521f11ff96b0b1317980e2">&#9670;&nbsp;</a></span>Finish()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class W &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classgrpc_1_1_server_async_writer.html">grpc::ServerAsyncWriter</a>&lt; W &gt;::Finish </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgrpc_1_1_status.html">grpc::Status</a> &amp;&#160;</td>
<td class="paramname"><em>status</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>tag</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>See the <em><a class="el" href="classgrpc_1_1_server_async_writer_interface.html#a3055aa0c0b7af061252e198ecad79c74" title="Indicate that the stream is to be finished with a certain status code.">ServerAsyncWriterInterface.Finish</a></em> method for semantics. </p>
<p>Implicit input parameter:</p><ul>
<li>the <em><a class="el" href="classgrpc_1_1_server_context.html" title="A ServerContext or CallbackServerContext allows the code implementing a service handler to:">ServerContext</a></em> associated with this call is used for sending trailing (and initial if not already sent) metadata to the client.</li>
</ul>
<p>Note: there are no restrictions are the code of <em>status</em>,it may be non-OK</p>
<p>gRPC doesn't take ownership or a reference to <em>status</em>, so it is safe to to deallocate once Finish returns. </p>
</div>
</div>
<a id="adbefffa0dd7ae810ed1c2bf877d46f96"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adbefffa0dd7ae810ed1c2bf877d46f96">&#9670;&nbsp;</a></span>SendInitialMetadata()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class W &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classgrpc_1_1_server_async_writer.html">grpc::ServerAsyncWriter</a>&lt; W &gt;::SendInitialMetadata </td>
<td>(</td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>tag</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>See <em>ServerAsyncStreamingInterface::SendInitialMetadata</em> for semantics. </p>
<p>Implicit input parameter:</p><ul>
<li>The initial metadata that will be sent to the client from this op will be taken from the <em><a class="el" href="classgrpc_1_1_server_context.html" title="A ServerContext or CallbackServerContext allows the code implementing a service handler to:">ServerContext</a></em> associated with the call.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">tag</td><td>Tag identifying this request. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a676fd381559f338580a67654e8247f90"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a676fd381559f338580a67654e8247f90">&#9670;&nbsp;</a></span>Write() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class W &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classgrpc_1_1_server_async_writer.html">grpc::ServerAsyncWriter</a>&lt; W &gt;::Write </td>
<td>(</td>
<td class="paramtype">const W &amp;&#160;</td>
<td class="paramname"><em>msg</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classgrpc_1_1_write_options.html">grpc::WriteOptions</a>&#160;</td>
<td class="paramname"><em>options</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>tag</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a467f70c7460ceb7738fb938b3bf93c85"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a467f70c7460ceb7738fb938b3bf93c85">&#9670;&nbsp;</a></span>Write() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class W &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classgrpc_1_1_server_async_writer.html">grpc::ServerAsyncWriter</a>&lt; W &gt;::Write </td>
<td>(</td>
<td class="paramtype">const W &amp;&#160;</td>
<td class="paramname"><em>msg</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>tag</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a26afb06eab6ba1c4b045aadf9881131a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a26afb06eab6ba1c4b045aadf9881131a">&#9670;&nbsp;</a></span>WriteAndFinish()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class W &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classgrpc_1_1_server_async_writer.html">grpc::ServerAsyncWriter</a>&lt; W &gt;::WriteAndFinish </td>
<td>(</td>
<td class="paramtype">const W &amp;&#160;</td>
<td class="paramname"><em>msg</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classgrpc_1_1_write_options.html">grpc::WriteOptions</a>&#160;</td>
<td class="paramname"><em>options</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classgrpc_1_1_status.html">grpc::Status</a> &amp;&#160;</td>
<td class="paramname"><em>status</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>tag</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>See the <em><a class="el" href="classgrpc_1_1_server_async_writer_interface.html#a7366392b0695df97520394208be1504b" title="Request the writing of msg and coalesce it with trailing metadata which contains status,...">ServerAsyncWriterInterface.WriteAndFinish</a></em> method for semantics. </p>
<p>Implicit input parameter:</p><ul>
<li>the <em><a class="el" href="classgrpc_1_1_server_context.html" title="A ServerContext or CallbackServerContext allows the code implementing a service handler to:">ServerContext</a></em> associated with this call is used for sending trailing (and initial) metadata to the client.</li>
</ul>
<p>Note: <em>status</em> must have an OK code.</p>
<p>gRPC doesn't take ownership or a reference to <em>msg</em> and <em>status</em>, so it is safe to deallocate once WriteAndFinish returns. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>include/grpcpp/<a class="el" href="grpcpp_2server__context_8h_source.html">server_context.h</a></li>
<li>include/grpcpp/support/<a class="el" href="grpcpp_2support_2async__stream_8h_source.html">async_stream.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Sep 6 2023 16:09:16 for GRPC C++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>