grpc/cpp/classgrpc_1_1_server_async_...

335 lines
19 KiB
HTML

<!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"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GRPC C++: grpc::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.22.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</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_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::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_1_1_server_async_reader.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="grpcpp_2impl_2codegen_2async__stream_8h_source.html">async_stream.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:a7f351e1d526b250336402ee03b8cc75e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc_1_1_server_async_reader.html#a7f351e1d526b250336402ee03b8cc75e">ServerAsyncReader</a> (<a class="el" href="namespacegrpc.html#a313a79de3d52893dd208c4efbf6662d2">ServerContext</a> *ctx)</td></tr>
<tr class="separator:a7f351e1d526b250336402ee03b8cc75e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3158928c9f07d695b3deeb39e5dd0982"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc_1_1_server_async_reader.html#a3158928c9f07d695b3deeb39e5dd0982">SendInitialMetadata</a> (void *tag) override</td></tr>
<tr class="memdesc:a3158928c9f07d695b3deeb39e5dd0982"><td class="mdescLeft">&#160;</td><td class="mdescRight">See <em>ServerAsyncStreamingInterface::SendInitialMetadata</em> for semantics. <a href="#a3158928c9f07d695b3deeb39e5dd0982">More...</a><br /></td></tr>
<tr class="separator:a3158928c9f07d695b3deeb39e5dd0982"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aefbe83b79433a6ae85f9f1ce913997c1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc_1_1_server_async_reader.html#aefbe83b79433a6ae85f9f1ce913997c1">Read</a> (R *msg, void *tag) override</td></tr>
<tr class="memdesc:aefbe83b79433a6ae85f9f1ce913997c1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a message of type <em>R</em> into <em>msg</em>. <a href="#aefbe83b79433a6ae85f9f1ce913997c1">More...</a><br /></td></tr>
<tr class="separator:aefbe83b79433a6ae85f9f1ce913997c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0245b202e3b715f3994b80153c1b9272"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc_1_1_server_async_reader.html#a0245b202e3b715f3994b80153c1b9272">Finish</a> (const W &amp;msg, const <a class="el" href="classgrpc_1_1_status.html">Status</a> &amp;status, void *tag) override</td></tr>
<tr class="memdesc:a0245b202e3b715f3994b80153c1b9272"><td class="mdescLeft">&#160;</td><td class="mdescRight">See the <em><a class="el" href="classgrpc_1_1internal_1_1_async_reader_interface.html#adf87c602036d69158950b7299d0aae70" title="Read a message of type R into msg. ">ServerAsyncReaderInterface.Read</a></em> method for semantics. <a href="#a0245b202e3b715f3994b80153c1b9272">More...</a><br /></td></tr>
<tr class="separator:a0245b202e3b715f3994b80153c1b9272"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20ec38517bcca2f0aa3c3a6f635caa2b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc_1_1_server_async_reader.html#a20ec38517bcca2f0aa3c3a6f635caa2b">FinishWithError</a> (const <a class="el" href="classgrpc_1_1_status.html">Status</a> &amp;status, void *tag) override</td></tr>
<tr class="memdesc:a20ec38517bcca2f0aa3c3a6f635caa2b"><td class="mdescLeft">&#160;</td><td class="mdescRight">See the <em><a class="el" href="classgrpc_1_1internal_1_1_async_reader_interface.html#adf87c602036d69158950b7299d0aae70" title="Read a message of type R into msg. ">ServerAsyncReaderInterface.Read</a></em> method for semantics. <a href="#a20ec38517bcca2f0aa3c3a6f635caa2b">More...</a><br /></td></tr>
<tr class="separator:a20ec38517bcca2f0aa3c3a6f635caa2b"><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_1_1internal_1_1_async_reader_interface"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classgrpc_1_1internal_1_1_async_reader_interface')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classgrpc_1_1internal_1_1_async_reader_interface.html">grpc::internal::AsyncReaderInterface&lt; R &gt;</a></td></tr>
<tr class="memitem:a18fe4235232864c8770a562cc2aa1f3c inherit pub_methods_classgrpc_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_1_1internal_1_1_async_reader_interface.html#a18fe4235232864c8770a562cc2aa1f3c">~AsyncReaderInterface</a> ()</td></tr>
<tr class="separator:a18fe4235232864c8770a562cc2aa1f3c inherit pub_methods_classgrpc_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::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="a7f351e1d526b250336402ee03b8cc75e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7f351e1d526b250336402ee03b8cc75e">&#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_1_1_server_async_reader.html">grpc::ServerAsyncReader</a>&lt; W, R &gt;::<a class="el" href="classgrpc_1_1_server_async_reader.html">ServerAsyncReader</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespacegrpc.html#a313a79de3d52893dd208c4efbf6662d2">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="a0245b202e3b715f3994b80153c1b9272"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0245b202e3b715f3994b80153c1b9272">&#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_1_1_server_async_reader.html">grpc::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">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_1_1internal_1_1_async_reader_interface.html#adf87c602036d69158950b7299d0aae70" 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>ServerContext</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_1_1_server_async_reader_interface.html#aad3ce656b43d5a8e2f2ce851514fc647">grpc::ServerAsyncReaderInterface&lt; W, R &gt;</a>.</p>
</div>
</div>
<a id="a20ec38517bcca2f0aa3c3a6f635caa2b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a20ec38517bcca2f0aa3c3a6f635caa2b">&#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_1_1_server_async_reader.html">grpc::ServerAsyncReader</a>&lt; W, R &gt;::FinishWithError </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgrpc_1_1_status.html">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_1_1internal_1_1_async_reader_interface.html#adf87c602036d69158950b7299d0aae70" 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>ServerContext</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_1_1_server_async_reader_interface.html#a39c4168fd67c1658f8ddbbfc52c095d2">grpc::ServerAsyncReaderInterface&lt; W, R &gt;</a>.</p>
</div>
</div>
<a id="aefbe83b79433a6ae85f9f1ce913997c1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aefbe83b79433a6ae85f9f1ce913997c1">&#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_1_1_server_async_reader.html">grpc::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_1_1internal_1_1_async_reader_interface.html#adf87c602036d69158950b7299d0aae70">grpc::internal::AsyncReaderInterface&lt; R &gt;</a>.</p>
</div>
</div>
<a id="a3158928c9f07d695b3deeb39e5dd0982"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3158928c9f07d695b3deeb39e5dd0982">&#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_1_1_server_async_reader.html">grpc::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>ServerContext</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="grpcpp_2impl_2codegen_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 Jul 3 2019 14:51:27 for GRPC C++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>