Grpc.Net.Client.GrpcChannel.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  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>Class GrpcChannel
  8. | gRPC for .NET </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class GrpcChannel
  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.Net.Client.GrpcChannel">
  73. <h1 id="Grpc_Net_Client_GrpcChannel" data-uid="Grpc.Net.Client.GrpcChannel" class="text-break">Class GrpcChannel
  74. </h1>
  75. <div class="markdown level0 summary"><p>Represents a gRPC channel. Channels are an abstraction of long-lived connections to remote servers.
  76. Client objects can reuse the same channel. Creating a channel is an expensive operation compared to invoking
  77. a remote call so in general you should reuse a single channel for as many calls as possible.</p>
  78. </div>
  79. <div class="markdown level0 conceptual"></div>
  80. <div class="inheritance">
  81. <h5>Inheritance</h5>
  82. <div class="level0"><span class="xref">ChannelBase</span></div>
  83. <div class="level1"><span class="xref">GrpcChannel</span></div>
  84. </div>
  85. <div classs="implements">
  86. <h5>Implements</h5>
  87. <div><span class="xref">IDisposable</span></div>
  88. </div>
  89. <h6><strong>Namespace</strong>: <a class="xref" href="Grpc.Net.Client.html">Grpc.Net.Client</a></h6>
  90. <h6><strong>Assembly</strong>: Grpc.Net.Client.dll</h6>
  91. <h5 id="Grpc_Net_Client_GrpcChannel_syntax">Syntax</h5>
  92. <div class="codewrapper">
  93. <pre><code class="lang-csharp hljs">public sealed class GrpcChannel : ChannelBase, IDisposable</code></pre>
  94. </div>
  95. <h3 id="methods">Methods
  96. </h3>
  97. <a id="Grpc_Net_Client_GrpcChannel_CreateCallInvoker_" data-uid="Grpc.Net.Client.GrpcChannel.CreateCallInvoker*"></a>
  98. <h4 id="Grpc_Net_Client_GrpcChannel_CreateCallInvoker" data-uid="Grpc.Net.Client.GrpcChannel.CreateCallInvoker">CreateCallInvoker()</h4>
  99. <div class="markdown level1 summary"><p>Create a new <see cref="!:CallInvoker"></see> for the channel.</p>
  100. </div>
  101. <div class="markdown level1 conceptual"></div>
  102. <h5 class="decalaration">Declaration</h5>
  103. <div class="codewrapper">
  104. <pre><code class="lang-csharp hljs">public override CallInvoker CreateCallInvoker()</code></pre>
  105. </div>
  106. <h5 class="returns">Returns</h5>
  107. <table class="table table-bordered table-striped table-condensed">
  108. <thead>
  109. <tr>
  110. <th>Type</th>
  111. <th>Description</th>
  112. </tr>
  113. </thead>
  114. <tbody>
  115. <tr>
  116. <td><span class="xref">CallInvoker</span></td>
  117. <td><p>A new <see cref="!:CallInvoker"></see>.</p>
  118. </td>
  119. </tr>
  120. </tbody>
  121. </table>
  122. <a id="Grpc_Net_Client_GrpcChannel_Dispose_" data-uid="Grpc.Net.Client.GrpcChannel.Dispose*"></a>
  123. <h4 id="Grpc_Net_Client_GrpcChannel_Dispose" data-uid="Grpc.Net.Client.GrpcChannel.Dispose">Dispose()</h4>
  124. <div class="markdown level1 summary"><p>Releases the resources used by the <a class="xref" href="Grpc.Net.Client.GrpcChannel.html">GrpcChannel</a> class.
  125. Clients created with the channel can&apos;t be used after the channel is disposed.</p>
  126. </div>
  127. <div class="markdown level1 conceptual"></div>
  128. <h5 class="decalaration">Declaration</h5>
  129. <div class="codewrapper">
  130. <pre><code class="lang-csharp hljs">public void Dispose()</code></pre>
  131. </div>
  132. <a id="Grpc_Net_Client_GrpcChannel_ForAddress_" data-uid="Grpc.Net.Client.GrpcChannel.ForAddress*"></a>
  133. <h4 id="Grpc_Net_Client_GrpcChannel_ForAddress_System_String_" data-uid="Grpc.Net.Client.GrpcChannel.ForAddress(System.String)">ForAddress(String)</h4>
  134. <div class="markdown level1 summary"><p>Creates a <a class="xref" href="Grpc.Net.Client.GrpcChannel.html">GrpcChannel</a> for the specified address.</p>
  135. </div>
  136. <div class="markdown level1 conceptual"></div>
  137. <h5 class="decalaration">Declaration</h5>
  138. <div class="codewrapper">
  139. <pre><code class="lang-csharp hljs">public static GrpcChannel ForAddress(string address)</code></pre>
  140. </div>
  141. <h5 class="parameters">Parameters</h5>
  142. <table class="table table-bordered table-striped table-condensed">
  143. <thead>
  144. <tr>
  145. <th>Type</th>
  146. <th>Name</th>
  147. <th>Description</th>
  148. </tr>
  149. </thead>
  150. <tbody>
  151. <tr>
  152. <td><span class="xref">System.String</span></td>
  153. <td><span class="parametername">address</span></td>
  154. <td><p>The address the channel will use.</p>
  155. </td>
  156. </tr>
  157. </tbody>
  158. </table>
  159. <h5 class="returns">Returns</h5>
  160. <table class="table table-bordered table-striped table-condensed">
  161. <thead>
  162. <tr>
  163. <th>Type</th>
  164. <th>Description</th>
  165. </tr>
  166. </thead>
  167. <tbody>
  168. <tr>
  169. <td><a class="xref" href="Grpc.Net.Client.GrpcChannel.html">GrpcChannel</a></td>
  170. <td><p>A new instance of <a class="xref" href="Grpc.Net.Client.GrpcChannel.html">GrpcChannel</a>.</p>
  171. </td>
  172. </tr>
  173. </tbody>
  174. </table>
  175. <a id="Grpc_Net_Client_GrpcChannel_ForAddress_" data-uid="Grpc.Net.Client.GrpcChannel.ForAddress*"></a>
  176. <h4 id="Grpc_Net_Client_GrpcChannel_ForAddress_System_String_Grpc_Net_Client_GrpcChannelOptions_" data-uid="Grpc.Net.Client.GrpcChannel.ForAddress(System.String,Grpc.Net.Client.GrpcChannelOptions)">ForAddress(String, GrpcChannelOptions)</h4>
  177. <div class="markdown level1 summary"><p>Creates a <a class="xref" href="Grpc.Net.Client.GrpcChannel.html">GrpcChannel</a> for the specified address and configuration options.</p>
  178. </div>
  179. <div class="markdown level1 conceptual"></div>
  180. <h5 class="decalaration">Declaration</h5>
  181. <div class="codewrapper">
  182. <pre><code class="lang-csharp hljs">public static GrpcChannel ForAddress(string address, GrpcChannelOptions channelOptions)</code></pre>
  183. </div>
  184. <h5 class="parameters">Parameters</h5>
  185. <table class="table table-bordered table-striped table-condensed">
  186. <thead>
  187. <tr>
  188. <th>Type</th>
  189. <th>Name</th>
  190. <th>Description</th>
  191. </tr>
  192. </thead>
  193. <tbody>
  194. <tr>
  195. <td><span class="xref">System.String</span></td>
  196. <td><span class="parametername">address</span></td>
  197. <td><p>The address the channel will use.</p>
  198. </td>
  199. </tr>
  200. <tr>
  201. <td><a class="xref" href="Grpc.Net.Client.GrpcChannelOptions.html">GrpcChannelOptions</a></td>
  202. <td><span class="parametername">channelOptions</span></td>
  203. <td><p>The channel configuration options.</p>
  204. </td>
  205. </tr>
  206. </tbody>
  207. </table>
  208. <h5 class="returns">Returns</h5>
  209. <table class="table table-bordered table-striped table-condensed">
  210. <thead>
  211. <tr>
  212. <th>Type</th>
  213. <th>Description</th>
  214. </tr>
  215. </thead>
  216. <tbody>
  217. <tr>
  218. <td><a class="xref" href="Grpc.Net.Client.GrpcChannel.html">GrpcChannel</a></td>
  219. <td><p>A new instance of <a class="xref" href="Grpc.Net.Client.GrpcChannel.html">GrpcChannel</a>.</p>
  220. </td>
  221. </tr>
  222. </tbody>
  223. </table>
  224. <a id="Grpc_Net_Client_GrpcChannel_ForAddress_" data-uid="Grpc.Net.Client.GrpcChannel.ForAddress*"></a>
  225. <h4 id="Grpc_Net_Client_GrpcChannel_ForAddress_Uri_" data-uid="Grpc.Net.Client.GrpcChannel.ForAddress(Uri)">ForAddress(Uri)</h4>
  226. <div class="markdown level1 summary"><p>Creates a <a class="xref" href="Grpc.Net.Client.GrpcChannel.html">GrpcChannel</a> for the specified address.</p>
  227. </div>
  228. <div class="markdown level1 conceptual"></div>
  229. <h5 class="decalaration">Declaration</h5>
  230. <div class="codewrapper">
  231. <pre><code class="lang-csharp hljs">public static GrpcChannel ForAddress(Uri address)</code></pre>
  232. </div>
  233. <h5 class="parameters">Parameters</h5>
  234. <table class="table table-bordered table-striped table-condensed">
  235. <thead>
  236. <tr>
  237. <th>Type</th>
  238. <th>Name</th>
  239. <th>Description</th>
  240. </tr>
  241. </thead>
  242. <tbody>
  243. <tr>
  244. <td><span class="xref">Uri</span></td>
  245. <td><span class="parametername">address</span></td>
  246. <td><p>The address the channel will use.</p>
  247. </td>
  248. </tr>
  249. </tbody>
  250. </table>
  251. <h5 class="returns">Returns</h5>
  252. <table class="table table-bordered table-striped table-condensed">
  253. <thead>
  254. <tr>
  255. <th>Type</th>
  256. <th>Description</th>
  257. </tr>
  258. </thead>
  259. <tbody>
  260. <tr>
  261. <td><a class="xref" href="Grpc.Net.Client.GrpcChannel.html">GrpcChannel</a></td>
  262. <td><p>A new instance of <a class="xref" href="Grpc.Net.Client.GrpcChannel.html">GrpcChannel</a>.</p>
  263. </td>
  264. </tr>
  265. </tbody>
  266. </table>
  267. <a id="Grpc_Net_Client_GrpcChannel_ForAddress_" data-uid="Grpc.Net.Client.GrpcChannel.ForAddress*"></a>
  268. <h4 id="Grpc_Net_Client_GrpcChannel_ForAddress_Uri_Grpc_Net_Client_GrpcChannelOptions_" data-uid="Grpc.Net.Client.GrpcChannel.ForAddress(Uri,Grpc.Net.Client.GrpcChannelOptions)">ForAddress(Uri, GrpcChannelOptions)</h4>
  269. <div class="markdown level1 summary"><p>Creates a <a class="xref" href="Grpc.Net.Client.GrpcChannel.html">GrpcChannel</a> for the specified address and configuration options.</p>
  270. </div>
  271. <div class="markdown level1 conceptual"></div>
  272. <h5 class="decalaration">Declaration</h5>
  273. <div class="codewrapper">
  274. <pre><code class="lang-csharp hljs">public static GrpcChannel ForAddress(Uri address, GrpcChannelOptions channelOptions)</code></pre>
  275. </div>
  276. <h5 class="parameters">Parameters</h5>
  277. <table class="table table-bordered table-striped table-condensed">
  278. <thead>
  279. <tr>
  280. <th>Type</th>
  281. <th>Name</th>
  282. <th>Description</th>
  283. </tr>
  284. </thead>
  285. <tbody>
  286. <tr>
  287. <td><span class="xref">Uri</span></td>
  288. <td><span class="parametername">address</span></td>
  289. <td><p>The address the channel will use.</p>
  290. </td>
  291. </tr>
  292. <tr>
  293. <td><a class="xref" href="Grpc.Net.Client.GrpcChannelOptions.html">GrpcChannelOptions</a></td>
  294. <td><span class="parametername">channelOptions</span></td>
  295. <td><p>The channel configuration options.</p>
  296. </td>
  297. </tr>
  298. </tbody>
  299. </table>
  300. <h5 class="returns">Returns</h5>
  301. <table class="table table-bordered table-striped table-condensed">
  302. <thead>
  303. <tr>
  304. <th>Type</th>
  305. <th>Description</th>
  306. </tr>
  307. </thead>
  308. <tbody>
  309. <tr>
  310. <td><a class="xref" href="Grpc.Net.Client.GrpcChannel.html">GrpcChannel</a></td>
  311. <td><p>A new instance of <a class="xref" href="Grpc.Net.Client.GrpcChannel.html">GrpcChannel</a>.</p>
  312. </td>
  313. </tr>
  314. </tbody>
  315. </table>
  316. <h3 id="implements">Implements</h3>
  317. <div>
  318. <span class="xref">IDisposable</span>
  319. </div>
  320. </article>
  321. </div>
  322. <div class="hidden-sm col-md-2" role="complementary">
  323. <div class="sideaffix">
  324. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  325. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  326. </nav>
  327. </div>
  328. </div>
  329. </div>
  330. </div>
  331. <footer>
  332. <div class="grad-bottom"></div>
  333. <div class="footer">
  334. <div class="container">
  335. <span class="pull-right">
  336. <a href="#top">Back to top</a>
  337. </span>
  338. <span>Generated by <strong>DocFX</strong></span>
  339. </div>
  340. </div>
  341. </footer>
  342. </div>
  343. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  344. <script type="text/javascript" src="../styles/docfx.js"></script>
  345. <script type="text/javascript" src="../styles/main.js"></script>
  346. </body>
  347. </html>