grpc/cpp/classgrpc__impl_1_1_server_...

338 lines
20 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_impl::ServerAsyncReader&lt; W, R &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.31.1</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__impl.html">grpc_impl</a></li><li class="navelem"><a class="el" href="classgrpc__impl_1_1_server_async_reader.html">ServerAsyncReader</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_impl::ServerAsyncReader&lt; W, R &gt; Class Template Reference<span class="mlabels"><span class="mlabel">final</span></span></div> </div>
</div><!--header-->
<div class="contents">
<p>Async server-side API for doing client-streaming RPCs, where the incoming message stream from the client has messages of type <em>R</em>, and the single response message sent from the server is type <em>W</em>.
<a href="classgrpc__impl_1_1_server_async_reader.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="impl_2codegen_2async__stream__impl_8h_source.html">async_stream_impl.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:a7168ac2e6d21a21f28c9bc9e997f35a3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1_server_async_reader.html#a7168ac2e6d21a21f28c9bc9e997f35a3">ServerAsyncReader</a> (::<a class="el" href="classgrpc__impl_1_1_server_context.html">grpc_impl::ServerContext</a> *ctx)</td></tr>
<tr class="separator:a7168ac2e6d21a21f28c9bc9e997f35a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a819572806103d461cd07f5cd076f04f9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1_server_async_reader.html#a819572806103d461cd07f5cd076f04f9">SendInitialMetadata</a> (void *tag) override</td></tr>
<tr class="memdesc:a819572806103d461cd07f5cd076f04f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">See <em>ServerAsyncStreamingInterface::SendInitialMetadata</em> for semantics. <a href="classgrpc__impl_1_1_server_async_reader.html#a819572806103d461cd07f5cd076f04f9">More...</a><br /></td></tr>
<tr class="separator:a819572806103d461cd07f5cd076f04f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abc05433351dff99d1686ec796573d94a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1_server_async_reader.html#abc05433351dff99d1686ec796573d94a">Read</a> (R *msg, void *tag) override</td></tr>
<tr class="memdesc:abc05433351dff99d1686ec796573d94a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a message of type <em>R</em> into <em>msg</em>. <a href="classgrpc__impl_1_1_server_async_reader.html#abc05433351dff99d1686ec796573d94a">More...</a><br /></td></tr>
<tr class="separator:abc05433351dff99d1686ec796573d94a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21e153db551dcb2f3f47dae50353008d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1_server_async_reader.html#a21e153db551dcb2f3f47dae50353008d">Finish</a> (const W &amp;msg, const ::<a class="el" href="classgrpc_1_1_status.html">grpc::Status</a> &amp;status, void *tag) override</td></tr>
<tr class="memdesc:a21e153db551dcb2f3f47dae50353008d"><td class="mdescLeft">&#160;</td><td class="mdescRight">See the <em><a class="el" href="classgrpc__impl_1_1internal_1_1_async_reader_interface.html#a02645c77e024a39abbd922650cfed5fd" title="Read a message of type R into msg.">ServerAsyncReaderInterface.Read</a></em> method for semantics. <a href="classgrpc__impl_1_1_server_async_reader.html#a21e153db551dcb2f3f47dae50353008d">More...</a><br /></td></tr>
<tr class="separator:a21e153db551dcb2f3f47dae50353008d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a372b5eaba33fc6fdf3644db711e5d2ba"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1_server_async_reader.html#a372b5eaba33fc6fdf3644db711e5d2ba">FinishWithError</a> (const ::<a class="el" href="classgrpc_1_1_status.html">grpc::Status</a> &amp;status, void *tag) override</td></tr>
<tr class="memdesc:a372b5eaba33fc6fdf3644db711e5d2ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">See the <em><a class="el" href="classgrpc__impl_1_1internal_1_1_async_reader_interface.html#a02645c77e024a39abbd922650cfed5fd" title="Read a message of type R into msg.">ServerAsyncReaderInterface.Read</a></em> method for semantics. <a href="classgrpc__impl_1_1_server_async_reader.html#a372b5eaba33fc6fdf3644db711e5d2ba">More...</a><br /></td></tr>
<tr class="separator:a372b5eaba33fc6fdf3644db711e5d2ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classgrpc_1_1internal_1_1_server_async_streaming_interface"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classgrpc_1_1internal_1_1_server_async_streaming_interface')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classgrpc_1_1internal_1_1_server_async_streaming_interface.html">grpc::internal::ServerAsyncStreamingInterface</a></td></tr>
<tr class="memitem:aeace2295f3792ce24975361c300d641a inherit pub_methods_classgrpc_1_1internal_1_1_server_async_streaming_interface"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc_1_1internal_1_1_server_async_streaming_interface.html#aeace2295f3792ce24975361c300d641a">~ServerAsyncStreamingInterface</a> ()</td></tr>
<tr class="separator:aeace2295f3792ce24975361c300d641a inherit pub_methods_classgrpc_1_1internal_1_1_server_async_streaming_interface"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classgrpc__impl_1_1internal_1_1_async_reader_interface"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classgrpc__impl_1_1internal_1_1_async_reader_interface')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classgrpc__impl_1_1internal_1_1_async_reader_interface.html">grpc_impl::internal::AsyncReaderInterface&lt; R &gt;</a></td></tr>
<tr class="memitem:a7034ab602111113f5bf3a8e6e48e2c93 inherit pub_methods_classgrpc__impl_1_1internal_1_1_async_reader_interface"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1internal_1_1_async_reader_interface.html#a7034ab602111113f5bf3a8e6e48e2c93">~AsyncReaderInterface</a> ()</td></tr>
<tr class="separator:a7034ab602111113f5bf3a8e6e48e2c93 inherit pub_methods_classgrpc__impl_1_1internal_1_1_async_reader_interface"><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, class R&gt;<br />
class grpc_impl::ServerAsyncReader&lt; W, R &gt;</h3>
<p>Async server-side API for doing client-streaming RPCs, where the incoming message stream from the client has messages of type <em>R</em>, and the single response message sent from the server is type <em>W</em>. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a7168ac2e6d21a21f28c9bc9e997f35a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7168ac2e6d21a21f28c9bc9e997f35a3">&#9670;&nbsp;</a></span>ServerAsyncReader()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class W , class R &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classgrpc__impl_1_1_server_async_reader.html">grpc_impl::ServerAsyncReader</a>&lt; W, R &gt;::<a class="el" href="classgrpc__impl_1_1_server_async_reader.html">ServerAsyncReader</a> </td>
<td>(</td>
<td class="paramtype">::<a class="el" href="classgrpc__impl_1_1_server_context.html">grpc_impl::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="a21e153db551dcb2f3f47dae50353008d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a21e153db551dcb2f3f47dae50353008d">&#9670;&nbsp;</a></span>Finish()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class W , class R &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classgrpc__impl_1_1_server_async_reader.html">grpc_impl::ServerAsyncReader</a>&lt; W, R &gt;::Finish </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">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 class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>See the <em><a class="el" href="classgrpc__impl_1_1internal_1_1_async_reader_interface.html#a02645c77e024a39abbd922650cfed5fd" title="Read a message of type R into msg.">ServerAsyncReaderInterface.Read</a></em> method for semantics. </p>
<p>Side effect:</p><ul>
<li>also sends initial metadata if not alreay sent.</li>
<li>uses the <em><a class="el" href="classgrpc__impl_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 to send possible initial and trailing metadata.</li>
</ul>
<p>Note: <em>msg</em> is not sent if <em>status</em> has a non-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 Finish returns. </p>
<p>Implements <a class="el" href="classgrpc__impl_1_1_server_async_reader_interface.html#aaa1f83b9c78fcde03437299101082343">grpc_impl::ServerAsyncReaderInterface&lt; W, R &gt;</a>.</p>
</div>
</div>
<a id="a372b5eaba33fc6fdf3644db711e5d2ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a372b5eaba33fc6fdf3644db711e5d2ba">&#9670;&nbsp;</a></span>FinishWithError()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class W , class R &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classgrpc__impl_1_1_server_async_reader.html">grpc_impl::ServerAsyncReader</a>&lt; W, R &gt;::FinishWithError </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 class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>See the <em><a class="el" href="classgrpc__impl_1_1internal_1_1_async_reader_interface.html#a02645c77e024a39abbd922650cfed5fd" title="Read a message of type R into msg.">ServerAsyncReaderInterface.Read</a></em> method for semantics. </p>
<p>Side effect:</p><ul>
<li>also sends initial metadata if not alreay sent.</li>
<li>uses the <em><a class="el" href="classgrpc__impl_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 to send possible initial and trailing metadata.</li>
</ul>
<p>gRPC doesn't take ownership or a reference to <em>status</em>, so it is safe to to deallocate once FinishWithError returns. </p>
<p>Implements <a class="el" href="classgrpc__impl_1_1_server_async_reader_interface.html#aeedb7cdf9fe807b1e84e34a14bb0bc63">grpc_impl::ServerAsyncReaderInterface&lt; W, R &gt;</a>.</p>
</div>
</div>
<a id="abc05433351dff99d1686ec796573d94a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abc05433351dff99d1686ec796573d94a">&#9670;&nbsp;</a></span>Read()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class W , class R &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classgrpc__impl_1_1_server_async_reader.html">grpc_impl::ServerAsyncReader</a>&lt; W, R &gt;::Read </td>
<td>(</td>
<td class="paramtype">R *&#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 class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Read a message of type <em>R</em> into <em>msg</em>. </p>
<p>Completion will be notified by <em>tag</em> on the associated completion queue. This is thread-safe with respect to <em>Write</em> or <em>WritesDone</em> methods. It should not be called concurrently with other streaming APIs on the same stream. It is not meaningful to call it concurrently with another <em>AsyncReaderInterface::Read</em> on the same stream since reads on the same stream are delivered in order.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">msg</td><td>Where to eventually store the read message. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">tag</td><td>The tag identifying the operation.</td></tr>
</table>
</dd>
</dl>
<p>Side effect: note that this method attempt to receive initial metadata for a stream if it hasn't yet been received. </p>
<p>Implements <a class="el" href="classgrpc__impl_1_1internal_1_1_async_reader_interface.html#a02645c77e024a39abbd922650cfed5fd">grpc_impl::internal::AsyncReaderInterface&lt; R &gt;</a>.</p>
</div>
</div>
<a id="a819572806103d461cd07f5cd076f04f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a819572806103d461cd07f5cd076f04f9">&#9670;&nbsp;</a></span>SendInitialMetadata()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class W , class R &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classgrpc__impl_1_1_server_async_reader.html">grpc_impl::ServerAsyncReader</a>&lt; W, R &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 class="mlabel">virtual</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__impl_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>
<p>Implements <a class="el" href="classgrpc_1_1internal_1_1_server_async_streaming_interface.html#ac55759faf2283db8bf716183881efe01">grpc::internal::ServerAsyncStreamingInterface</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/grpcpp/impl/codegen/<a class="el" href="impl_2codegen_2async__stream__impl_8h_source.html">async_stream_impl.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Aug 18 2020 16:24:48 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>