Grpc.Core.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Namespace Grpc.Core
  8. | gRPC for .NET </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Namespace Grpc.Core
  11. | gRPC for .NET ">
  12. <meta name="generator" content="docfx 2.36.0.0">
  13. <link rel="shortcut icon" href="../favicon.ico">
  14. <link rel="stylesheet" href="../styles/docfx.vendor.css">
  15. <link rel="stylesheet" href="../styles/docfx.css">
  16. <link rel="stylesheet" href="../styles/main.css">
  17. <meta property="docfx:navrel" content="../toc.html">
  18. <meta property="docfx:tocrel" content="toc.html">
  19. <meta property="docfx:rel" content="../">
  20. </head>
  21. <body data-spy="scroll" data-target="#affix" data-offset="120">
  22. <div id="wrapper">
  23. <header>
  24. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  25. <div class="container">
  26. <div class="navbar-header">
  27. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  28. <span class="sr-only">Toggle navigation</span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. </button>
  33. <a class="navbar-brand" href="../index.html">
  34. <img id="logo" class="svg" src="../logo.svg" alt="">
  35. </a>
  36. </div>
  37. <div class="collapse navbar-collapse" id="navbar">
  38. <form class="navbar-form navbar-right" role="search" id="search">
  39. <div class="form-group">
  40. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  41. </div>
  42. </form>
  43. </div>
  44. </div>
  45. </nav>
  46. <div class="subnav navbar navbar-default">
  47. <div class="container hide-when-search" id="breadcrumb">
  48. <ul class="breadcrumb">
  49. <li></li>
  50. </ul>
  51. </div>
  52. </div>
  53. </header>
  54. <div class="container body-content">
  55. <div id="search-results">
  56. <div class="search-list"></div>
  57. <div class="sr-items">
  58. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  59. </div>
  60. <ul id="pagination"></ul>
  61. </div>
  62. </div>
  63. <div role="main" class="container body-content hide-when-search">
  64. <div class="sidenav hide-when-search">
  65. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  66. <div class="sidetoggle collapse" id="sidetoggle">
  67. <div id="sidetoc"></div>
  68. </div>
  69. </div>
  70. <div class="article row grid-right">
  71. <div class="col-md-10">
  72. <article class="content wrap" id="_content" data-uid="Grpc.Core">
  73. <h1 id="Grpc_Core" data-uid="Grpc.Core" class="text-break">Namespace Grpc.Core
  74. </h1>
  75. <div class="markdown level0 summary"></div>
  76. <div class="markdown level0 conceptual"></div>
  77. <div class="markdown level0 remarks"></div>
  78. <h3 id="classes">Classes
  79. </h3>
  80. <h4><a class="xref" href="Grpc.Core.AsyncClientStreamingCall-2.html">AsyncClientStreamingCall&lt;TRequest, TResponse&gt;</a></h4>
  81. <section><p>Return type for client streaming calls.</p>
  82. </section>
  83. <h4><a class="xref" href="Grpc.Core.AsyncDuplexStreamingCall-2.html">AsyncDuplexStreamingCall&lt;TRequest, TResponse&gt;</a></h4>
  84. <section><p>Return type for bidirectional streaming calls.</p>
  85. </section>
  86. <h4><a class="xref" href="Grpc.Core.AsyncServerStreamingCall-1.html">AsyncServerStreamingCall&lt;TResponse&gt;</a></h4>
  87. <section><p>Return type for server streaming calls.</p>
  88. </section>
  89. <h4><a class="xref" href="Grpc.Core.AsyncStreamReaderExtensions.html">AsyncStreamReaderExtensions</a></h4>
  90. <section><p>Extension methods for <a class="xref" href="Grpc.Core.IAsyncStreamReader-1.html">IAsyncStreamReader&lt;T&gt;</a>.</p>
  91. </section>
  92. <h4><a class="xref" href="Grpc.Core.AsyncUnaryCall-1.html">AsyncUnaryCall&lt;TResponse&gt;</a></h4>
  93. <section><p>Return type for single request - single response call.</p>
  94. </section>
  95. <h4><a class="xref" href="Grpc.Core.AuthContext.html">AuthContext</a></h4>
  96. <section><p>Authentication context for a call.
  97. AuthContext is the only reliable source of truth when it comes to authenticating calls.
  98. Using any other call/context properties for authentication purposes is wrong and inherently unsafe.
  99. Note: experimental API that can change or be removed without any prior notice.</p>
  100. </section>
  101. <h4><a class="xref" href="Grpc.Core.AuthInterceptorContext.html">AuthInterceptorContext</a></h4>
  102. <section><p>Context for an RPC being intercepted by <a class="xref" href="Grpc.Core.AsyncAuthInterceptor.html">AsyncAuthInterceptor</a>.</p>
  103. </section>
  104. <h4><a class="xref" href="Grpc.Core.AuthProperty.html">AuthProperty</a></h4>
  105. <section><p>A property of an <a class="xref" href="Grpc.Core.AuthContext.html">AuthContext</a>.
  106. Note: experimental API that can change or be removed without any prior notice.</p>
  107. </section>
  108. <h4><a class="xref" href="Grpc.Core.BindServiceMethodAttribute.html">BindServiceMethodAttribute</a></h4>
  109. <section><p>Specifies the location of the service bind method for a gRPC service.
  110. The bind method is typically generated code and is used to register a service&apos;s
  111. methods with the server on startup.</p>
  112. <p>The bind method signature takes a <a class="xref" href="Grpc.Core.ServiceBinderBase.html">ServiceBinderBase</a> and an optional
  113. instance of the service base class, e.g. <code>static void BindService(ServiceBinderBase, GreeterService)</code>.</p>
  114. </section>
  115. <h4><a class="xref" href="Grpc.Core.CallCredentials.html">CallCredentials</a></h4>
  116. <section><p>Client-side call credentials. Provide authorization with per-call granularity.</p>
  117. </section>
  118. <h4><a class="xref" href="Grpc.Core.CallCredentialsConfiguratorBase.html">CallCredentialsConfiguratorBase</a></h4>
  119. <section><p>Base class for objects that can consume configuration from <code>CallCredentials</code> objects.
  120. Note: experimental API that can change or be removed without any prior notice.</p>
  121. </section>
  122. <h4><a class="xref" href="Grpc.Core.CallInvoker.html">CallInvoker</a></h4>
  123. <section><p>Abstraction of client-side RPC invocation.</p>
  124. </section>
  125. <h4><a class="xref" href="Grpc.Core.ChannelBase.html">ChannelBase</a></h4>
  126. <section><p>Base class for gRPC channel. Channels are an abstraction of long-lived connections to remote servers.</p>
  127. </section>
  128. <h4><a class="xref" href="Grpc.Core.ChannelCredentials.html">ChannelCredentials</a></h4>
  129. <section><p>Client-side channel credentials. Used for creation of a secure channel.</p>
  130. </section>
  131. <h4><a class="xref" href="Grpc.Core.ChannelCredentialsConfiguratorBase.html">ChannelCredentialsConfiguratorBase</a></h4>
  132. <section><p>Base class for objects that can consume configuration from <code>CallCredentials</code> objects.
  133. Note: experimental API that can change or be removed without any prior notice.</p>
  134. </section>
  135. <h4><a class="xref" href="Grpc.Core.ClientBase.html">ClientBase</a></h4>
  136. <section><p>Base class for client-side stubs.</p>
  137. </section>
  138. <h4><a class="xref" href="Grpc.Core.ClientBase.ClientBaseConfiguration.html">ClientBase.ClientBaseConfiguration</a></h4>
  139. <section><p>Represents configuration of ClientBase. The class itself is visible to
  140. subclasses, but contents are marked as internal to make the instances opaque.
  141. The verbose name of this class was chosen to make name clash in generated code
  142. less likely.</p>
  143. </section>
  144. <h4><a class="xref" href="Grpc.Core.ClientBase-1.html">ClientBase&lt;T&gt;</a></h4>
  145. <section><p>Generic base class for client-side stubs.</p>
  146. </section>
  147. <h4><a class="xref" href="Grpc.Core.ContextPropagationOptions.html">ContextPropagationOptions</a></h4>
  148. <section><p>Options for <a class="xref" href="Grpc.Core.ContextPropagationToken.html">ContextPropagationToken</a>.</p>
  149. </section>
  150. <h4><a class="xref" href="Grpc.Core.ContextPropagationToken.html">ContextPropagationToken</a></h4>
  151. <section><p>Token for propagating context of server side handlers to child calls.
  152. In situations when a backend is making calls to another backend,
  153. it makes sense to propagate properties like deadline and cancellation
  154. token of the server call to the child call.
  155. Underlying gRPC implementation may provide other &quot;opaque&quot; contexts (like tracing context) that
  156. are not explicitly accesible via the public C# API, but this token still allows propagating them.</p>
  157. </section>
  158. <h4><a class="xref" href="Grpc.Core.DeserializationContext.html">DeserializationContext</a></h4>
  159. <section><p>Provides access to the payload being deserialized when deserializing messages.</p>
  160. </section>
  161. <h4><a class="xref" href="Grpc.Core.KeyCertificatePair.html">KeyCertificatePair</a></h4>
  162. <section><p>Key certificate pair (in PEM encoding).</p>
  163. </section>
  164. <h4><a class="xref" href="Grpc.Core.LiteClientBase.html">LiteClientBase</a></h4>
  165. <section><p>Base class for lightweight client-side stubs.
  166. All calls are invoked via a <code>CallInvoker</code>.
  167. Lite client stubs have no configuration knobs, all configuration
  168. is provided by decorating the call invoker.
  169. Note: experimental API that can change or be removed without any prior notice.</p>
  170. </section>
  171. <h4><a class="xref" href="Grpc.Core.Marshaller-1.html">Marshaller&lt;T&gt;</a></h4>
  172. <section><p>Encapsulates the logic for serializing and deserializing messages.</p>
  173. </section>
  174. <h4><a class="xref" href="Grpc.Core.Marshallers.html">Marshallers</a></h4>
  175. <section><p>Utilities for creating marshallers.</p>
  176. </section>
  177. <h4><a class="xref" href="Grpc.Core.Metadata.html">Metadata</a></h4>
  178. <section><p>A collection of metadata entries that can be exchanged during a call.
  179. gRPC supports these types of metadata:
  180. <ul><li>Request headersare sent by the client at the beginning of a remote call before any request messages are sent.</li><li>Response headersare sent by the server at the beginning of a remote call handler before any response messages are sent.</li><li>Response trailersare sent by the server at the end of a remote call along with resulting call status.</li></ul></p>
  181. </section>
  182. <h4><a class="xref" href="Grpc.Core.Metadata.Entry.html">Metadata.Entry</a></h4>
  183. <section><p>Metadata entry</p>
  184. </section>
  185. <h4><a class="xref" href="Grpc.Core.Method-2.html">Method&lt;TRequest, TResponse&gt;</a></h4>
  186. <section><p>A description of a remote method.</p>
  187. </section>
  188. <h4><a class="xref" href="Grpc.Core.RpcException.html">RpcException</a></h4>
  189. <section><p>Thrown when remote procedure call fails. Every <code>RpcException</code> is associated with a resulting <a class="xref" href="Grpc.Core.RpcException.html#Grpc_Core_RpcException_Status">Status</a> of the call.</p>
  190. </section>
  191. <h4><a class="xref" href="Grpc.Core.SerializationContext.html">SerializationContext</a></h4>
  192. <section><p>Provides storage for payload when serializing a message.</p>
  193. </section>
  194. <h4><a class="xref" href="Grpc.Core.ServerCallContext.html">ServerCallContext</a></h4>
  195. <section><p>Context for a server-side call.</p>
  196. </section>
  197. <h4><a class="xref" href="Grpc.Core.ServerCallContextExtensions.html">ServerCallContextExtensions</a></h4>
  198. <section><p>Extension methods for ServerCallContext.</p>
  199. </section>
  200. <h4><a class="xref" href="Grpc.Core.ServerServiceDefinition.html">ServerServiceDefinition</a></h4>
  201. <section><p>Stores mapping of methods to server call handlers.
  202. Normally, the <code>ServerServiceDefinition</code> objects will be created by the <code>BindService</code> factory method
  203. that is part of the autogenerated code for a protocol buffers service definition.</p>
  204. </section>
  205. <h4><a class="xref" href="Grpc.Core.ServerServiceDefinition.Builder.html">ServerServiceDefinition.Builder</a></h4>
  206. <section><p>Builder class for <a class="xref" href="Grpc.Core.ServerServiceDefinition.html">ServerServiceDefinition</a>.</p>
  207. </section>
  208. <h4><a class="xref" href="Grpc.Core.ServiceBinderBase.html">ServiceBinderBase</a></h4>
  209. <section><p>Allows binding server-side method implementations in alternative serving stacks.
  210. Instances of this class are usually populated by the <code>BindService</code> method
  211. that is part of the autogenerated code for a protocol buffers service definition.</p>
  212. </section>
  213. <h4><a class="xref" href="Grpc.Core.SslCredentials.html">SslCredentials</a></h4>
  214. <section><p>Client-side SSL credentials.</p>
  215. </section>
  216. <h4><a class="xref" href="Grpc.Core.VerifyPeerContext.html">VerifyPeerContext</a></h4>
  217. <section><p>Verification context for VerifyPeerCallback.
  218. Note: experimental API that can change or be removed without any prior notice.</p>
  219. </section>
  220. <h4><a class="xref" href="Grpc.Core.VersionInfo.html">VersionInfo</a></h4>
  221. <section><p>Provides info about current version of gRPC.
  222. See <a href="https://codingforsmarties.wordpress.com/2016/01/21/how-to-version-assemblies-destined-for-nuget/">https://codingforsmarties.wordpress.com/2016/01/21/how-to-version-assemblies-destined-for-nuget/</a>
  223. for rationale about assembly versioning.</p>
  224. </section>
  225. <h4><a class="xref" href="Grpc.Core.WriteOptions.html">WriteOptions</a></h4>
  226. <section><p>Options for write operations.</p>
  227. </section>
  228. <h3 id="structs">Structs
  229. </h3>
  230. <h4><a class="xref" href="Grpc.Core.CallOptions.html">CallOptions</a></h4>
  231. <section><p>Options for calls made by client.</p>
  232. </section>
  233. <h4><a class="xref" href="Grpc.Core.Status.html">Status</a></h4>
  234. <section><p>Represents RPC result, which consists of <a class="xref" href="Grpc.Core.Status.html#Grpc_Core_Status_StatusCode">StatusCode</a> and an optional detail string.</p>
  235. </section>
  236. <h3 id="interfaces">Interfaces
  237. </h3>
  238. <h4><a class="xref" href="Grpc.Core.IAsyncStreamReader-1.html">IAsyncStreamReader&lt;T&gt;</a></h4>
  239. <section><p>A stream of messages to be read.
  240. Messages can be awaited <code>await reader.MoveNext()</code>, that returns <code>true</code>
  241. if there is a message available and <code>false</code> if there are no more messages
  242. (i.e. the stream has been closed).
  243. <p>
  244. On the client side, the last invocation of <code>MoveNext()</code> either returns <code>false</code>
  245. if the call has finished successfully or throws <code>RpcException</code> if call finished
  246. with an error. Once the call finishes, subsequent invocations of <code>MoveNext()</code> will
  247. continue yielding the same result (returning <code>false</code> or throwing an exception).
  248. </p>
  249. <p>
  250. On the server side, <code>MoveNext()</code> does not throw exceptions.
  251. In case of a failure, the request stream will appear to be finished
  252. (<code>MoveNext</code> will return <code>false</code>) and the <code>CancellationToken</code>
  253. associated with the call will be cancelled to signal the failure.
  254. </p>
  255. <p>
  256. <code>MoveNext()</code> operations can be cancelled via a cancellation token. Cancelling
  257. an individual read operation has the same effect as cancelling the entire call
  258. (which will also result in the read operation returning prematurely), but the per-read cancellation
  259. tokens passed to MoveNext() only result in cancelling the call if the read operation haven&apos;t finished
  260. yet.
  261. </p></p>
  262. </section>
  263. <h4><a class="xref" href="Grpc.Core.IAsyncStreamWriter-1.html">IAsyncStreamWriter&lt;T&gt;</a></h4>
  264. <section><p>A writable stream of messages.</p>
  265. </section>
  266. <h4><a class="xref" href="Grpc.Core.IClientStreamWriter-1.html">IClientStreamWriter&lt;T&gt;</a></h4>
  267. <section><p>Client-side writable stream of messages with Close capability.</p>
  268. </section>
  269. <h4><a class="xref" href="Grpc.Core.IMethod.html">IMethod</a></h4>
  270. <section><p>A non-generic representation of a remote method.</p>
  271. </section>
  272. <h4><a class="xref" href="Grpc.Core.IServerStreamWriter-1.html">IServerStreamWriter&lt;T&gt;</a></h4>
  273. <section><p>A writable stream of messages that is used in server-side handlers.</p>
  274. </section>
  275. <h3 id="enums">Enums
  276. </h3>
  277. <h4><a class="xref" href="Grpc.Core.MethodType.html">MethodType</a></h4>
  278. <section><p>Method types supported by gRPC.</p>
  279. </section>
  280. <h4><a class="xref" href="Grpc.Core.StatusCode.html">StatusCode</a></h4>
  281. <section><p>Result of a remote procedure call.
  282. Based on grpc_status_code from grpc/status.h</p>
  283. </section>
  284. <h4><a class="xref" href="Grpc.Core.WriteFlags.html">WriteFlags</a></h4>
  285. <section><p>Flags for write operations.</p>
  286. </section>
  287. <h3 id="delegates">Delegates
  288. </h3>
  289. <h4><a class="xref" href="Grpc.Core.AsyncAuthInterceptor.html">AsyncAuthInterceptor</a></h4>
  290. <section><p>Asynchronous authentication interceptor for <a class="xref" href="Grpc.Core.CallCredentials.html">CallCredentials</a>.</p>
  291. </section>
  292. <h4><a class="xref" href="Grpc.Core.ClientStreamingServerMethod-2.html">ClientStreamingServerMethod&lt;TRequest, TResponse&gt;</a></h4>
  293. <section><p>Server-side handler for client streaming call.</p>
  294. </section>
  295. <h4><a class="xref" href="Grpc.Core.DuplexStreamingServerMethod-2.html">DuplexStreamingServerMethod&lt;TRequest, TResponse&gt;</a></h4>
  296. <section><p>Server-side handler for bidi streaming call.</p>
  297. </section>
  298. <h4><a class="xref" href="Grpc.Core.ServerStreamingServerMethod-2.html">ServerStreamingServerMethod&lt;TRequest, TResponse&gt;</a></h4>
  299. <section><p>Server-side handler for server streaming call.</p>
  300. </section>
  301. <h4><a class="xref" href="Grpc.Core.UnaryServerMethod-2.html">UnaryServerMethod&lt;TRequest, TResponse&gt;</a></h4>
  302. <section><p>Server-side handler for unary call.</p>
  303. </section>
  304. <h4><a class="xref" href="Grpc.Core.VerifyPeerCallback.html">VerifyPeerCallback</a></h4>
  305. <section><p>Callback invoked with the expected targetHost and the peer&apos;s certificate.
  306. If false is returned by this callback then it is treated as a
  307. verification failure and the attempted connection will fail.
  308. Invocation of the callback is blocking, so any
  309. implementation should be light-weight.
  310. Note that the callback can potentially be invoked multiple times,
  311. concurrently from different threads (e.g. when multiple connections
  312. are being created for the same credentials).</p>
  313. </section>
  314. </article>
  315. </div>
  316. <div class="hidden-sm col-md-2" role="complementary">
  317. <div class="sideaffix">
  318. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  319. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  320. </nav>
  321. </div>
  322. </div>
  323. </div>
  324. </div>
  325. <footer>
  326. <div class="grad-bottom"></div>
  327. <div class="footer">
  328. <div class="container">
  329. <span class="pull-right">
  330. <a href="#top">Back to top</a>
  331. </span>
  332. <span>Generated by <strong>DocFX</strong></span>
  333. </div>
  334. </div>
  335. </footer>
  336. </div>
  337. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  338. <script type="text/javascript" src="../styles/docfx.js"></script>
  339. <script type="text/javascript" src="../styles/main.js"></script>
  340. </body>
  341. </html>