Grpc.Core.Channel.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  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 Channel
  8. | gRPC C# </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class Channel
  11. | gRPC C# ">
  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.Channel">
  73. <h1 id="Grpc_Core_Channel" data-uid="Grpc.Core.Channel" class="text-break">Class Channel
  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. More 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">System.Object</span></div>
  83. <div class="level1"><a class="xref" href="Grpc.Core.ChannelBase.html">ChannelBase</a></div>
  84. <div class="level2"><span class="xref">Channel</span></div>
  85. </div>
  86. <div class="inheritedMembers">
  87. <h5>Inherited Members</h5>
  88. <div>
  89. <a class="xref" href="Grpc.Core.ChannelBase.html#Grpc_Core_ChannelBase_Target">ChannelBase.Target</a>
  90. </div>
  91. <div>
  92. <a class="xref" href="Grpc.Core.ChannelBase.html#Grpc_Core_ChannelBase_ShutdownAsync">ChannelBase.ShutdownAsync()</a>
  93. </div>
  94. <div>
  95. <span class="xref">System.Object.Equals(System.Object)</span>
  96. </div>
  97. <div>
  98. <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
  99. </div>
  100. <div>
  101. <span class="xref">System.Object.GetHashCode()</span>
  102. </div>
  103. <div>
  104. <span class="xref">System.Object.GetType()</span>
  105. </div>
  106. <div>
  107. <span class="xref">System.Object.MemberwiseClone()</span>
  108. </div>
  109. <div>
  110. <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
  111. </div>
  112. <div>
  113. <span class="xref">System.Object.ToString()</span>
  114. </div>
  115. </div>
  116. <h6><strong>Namespace</strong>: <a class="xref" href="Grpc.Core.html">Grpc.Core</a></h6>
  117. <h6><strong>Assembly</strong>: Grpc.Core.dll</h6>
  118. <h5 id="Grpc_Core_Channel_syntax">Syntax</h5>
  119. <div class="codewrapper">
  120. <pre><code class="lang-csharp hljs">public class Channel : ChannelBase</code></pre>
  121. </div>
  122. <h3 id="constructors">Constructors
  123. </h3>
  124. <a id="Grpc_Core_Channel__ctor_" data-uid="Grpc.Core.Channel.#ctor*"></a>
  125. <h4 id="Grpc_Core_Channel__ctor_System_String_Grpc_Core_ChannelCredentials_" data-uid="Grpc.Core.Channel.#ctor(System.String,Grpc.Core.ChannelCredentials)">Channel(String, ChannelCredentials)</h4>
  126. <div class="markdown level1 summary"><p>Creates a channel that connects to a specific host.
  127. Port will default to 80 for an unsecure channel and to 443 for a secure channel.</p>
  128. </div>
  129. <div class="markdown level1 conceptual"></div>
  130. <h5 class="decalaration">Declaration</h5>
  131. <div class="codewrapper">
  132. <pre><code class="lang-csharp hljs">public Channel(string target, ChannelCredentials credentials)</code></pre>
  133. </div>
  134. <h5 class="parameters">Parameters</h5>
  135. <table class="table table-bordered table-striped table-condensed">
  136. <thead>
  137. <tr>
  138. <th>Type</th>
  139. <th>Name</th>
  140. <th>Description</th>
  141. </tr>
  142. </thead>
  143. <tbody>
  144. <tr>
  145. <td><span class="xref">System.String</span></td>
  146. <td><span class="parametername">target</span></td>
  147. <td><p>Target of the channel.</p>
  148. </td>
  149. </tr>
  150. <tr>
  151. <td><a class="xref" href="Grpc.Core.ChannelCredentials.html">ChannelCredentials</a></td>
  152. <td><span class="parametername">credentials</span></td>
  153. <td><p>Credentials to secure the channel.</p>
  154. </td>
  155. </tr>
  156. </tbody>
  157. </table>
  158. <a id="Grpc_Core_Channel__ctor_" data-uid="Grpc.Core.Channel.#ctor*"></a>
  159. <h4 id="Grpc_Core_Channel__ctor_System_String_Grpc_Core_ChannelCredentials_System_Collections_Generic_IEnumerable_Grpc_Core_ChannelOption__" data-uid="Grpc.Core.Channel.#ctor(System.String,Grpc.Core.ChannelCredentials,System.Collections.Generic.IEnumerable{Grpc.Core.ChannelOption})">Channel(String, ChannelCredentials, IEnumerable&lt;ChannelOption&gt;)</h4>
  160. <div class="markdown level1 summary"><p>Creates a channel that connects to a specific host.
  161. Port will default to 80 for an unsecure channel or to 443 for a secure channel.</p>
  162. </div>
  163. <div class="markdown level1 conceptual"></div>
  164. <h5 class="decalaration">Declaration</h5>
  165. <div class="codewrapper">
  166. <pre><code class="lang-csharp hljs">public Channel(string target, ChannelCredentials credentials, IEnumerable&lt;ChannelOption&gt; options)</code></pre>
  167. </div>
  168. <h5 class="parameters">Parameters</h5>
  169. <table class="table table-bordered table-striped table-condensed">
  170. <thead>
  171. <tr>
  172. <th>Type</th>
  173. <th>Name</th>
  174. <th>Description</th>
  175. </tr>
  176. </thead>
  177. <tbody>
  178. <tr>
  179. <td><span class="xref">System.String</span></td>
  180. <td><span class="parametername">target</span></td>
  181. <td><p>Target of the channel.</p>
  182. </td>
  183. </tr>
  184. <tr>
  185. <td><a class="xref" href="Grpc.Core.ChannelCredentials.html">ChannelCredentials</a></td>
  186. <td><span class="parametername">credentials</span></td>
  187. <td><p>Credentials to secure the channel.</p>
  188. </td>
  189. </tr>
  190. <tr>
  191. <td><span class="xref">System.Collections.Generic.IEnumerable</span>&lt;<a class="xref" href="Grpc.Core.ChannelOption.html">ChannelOption</a>&gt;</td>
  192. <td><span class="parametername">options</span></td>
  193. <td><p>Channel options.</p>
  194. </td>
  195. </tr>
  196. </tbody>
  197. </table>
  198. <a id="Grpc_Core_Channel__ctor_" data-uid="Grpc.Core.Channel.#ctor*"></a>
  199. <h4 id="Grpc_Core_Channel__ctor_System_String_System_Int32_Grpc_Core_ChannelCredentials_" data-uid="Grpc.Core.Channel.#ctor(System.String,System.Int32,Grpc.Core.ChannelCredentials)">Channel(String, Int32, ChannelCredentials)</h4>
  200. <div class="markdown level1 summary"><p>Creates a channel that connects to a specific host and port.</p>
  201. </div>
  202. <div class="markdown level1 conceptual"></div>
  203. <h5 class="decalaration">Declaration</h5>
  204. <div class="codewrapper">
  205. <pre><code class="lang-csharp hljs">public Channel(string host, int port, ChannelCredentials credentials)</code></pre>
  206. </div>
  207. <h5 class="parameters">Parameters</h5>
  208. <table class="table table-bordered table-striped table-condensed">
  209. <thead>
  210. <tr>
  211. <th>Type</th>
  212. <th>Name</th>
  213. <th>Description</th>
  214. </tr>
  215. </thead>
  216. <tbody>
  217. <tr>
  218. <td><span class="xref">System.String</span></td>
  219. <td><span class="parametername">host</span></td>
  220. <td><p>The name or IP address of the host.</p>
  221. </td>
  222. </tr>
  223. <tr>
  224. <td><span class="xref">System.Int32</span></td>
  225. <td><span class="parametername">port</span></td>
  226. <td><p>The port.</p>
  227. </td>
  228. </tr>
  229. <tr>
  230. <td><a class="xref" href="Grpc.Core.ChannelCredentials.html">ChannelCredentials</a></td>
  231. <td><span class="parametername">credentials</span></td>
  232. <td><p>Credentials to secure the channel.</p>
  233. </td>
  234. </tr>
  235. </tbody>
  236. </table>
  237. <a id="Grpc_Core_Channel__ctor_" data-uid="Grpc.Core.Channel.#ctor*"></a>
  238. <h4 id="Grpc_Core_Channel__ctor_System_String_System_Int32_Grpc_Core_ChannelCredentials_System_Collections_Generic_IEnumerable_Grpc_Core_ChannelOption__" data-uid="Grpc.Core.Channel.#ctor(System.String,System.Int32,Grpc.Core.ChannelCredentials,System.Collections.Generic.IEnumerable{Grpc.Core.ChannelOption})">Channel(String, Int32, ChannelCredentials, IEnumerable&lt;ChannelOption&gt;)</h4>
  239. <div class="markdown level1 summary"><p>Creates a channel that connects to a specific host and port.</p>
  240. </div>
  241. <div class="markdown level1 conceptual"></div>
  242. <h5 class="decalaration">Declaration</h5>
  243. <div class="codewrapper">
  244. <pre><code class="lang-csharp hljs">public Channel(string host, int port, ChannelCredentials credentials, IEnumerable&lt;ChannelOption&gt; options)</code></pre>
  245. </div>
  246. <h5 class="parameters">Parameters</h5>
  247. <table class="table table-bordered table-striped table-condensed">
  248. <thead>
  249. <tr>
  250. <th>Type</th>
  251. <th>Name</th>
  252. <th>Description</th>
  253. </tr>
  254. </thead>
  255. <tbody>
  256. <tr>
  257. <td><span class="xref">System.String</span></td>
  258. <td><span class="parametername">host</span></td>
  259. <td><p>The name or IP address of the host.</p>
  260. </td>
  261. </tr>
  262. <tr>
  263. <td><span class="xref">System.Int32</span></td>
  264. <td><span class="parametername">port</span></td>
  265. <td><p>The port.</p>
  266. </td>
  267. </tr>
  268. <tr>
  269. <td><a class="xref" href="Grpc.Core.ChannelCredentials.html">ChannelCredentials</a></td>
  270. <td><span class="parametername">credentials</span></td>
  271. <td><p>Credentials to secure the channel.</p>
  272. </td>
  273. </tr>
  274. <tr>
  275. <td><span class="xref">System.Collections.Generic.IEnumerable</span>&lt;<a class="xref" href="Grpc.Core.ChannelOption.html">ChannelOption</a>&gt;</td>
  276. <td><span class="parametername">options</span></td>
  277. <td><p>Channel options.</p>
  278. </td>
  279. </tr>
  280. </tbody>
  281. </table>
  282. <h3 id="properties">Properties
  283. </h3>
  284. <a id="Grpc_Core_Channel_ResolvedTarget_" data-uid="Grpc.Core.Channel.ResolvedTarget*"></a>
  285. <h4 id="Grpc_Core_Channel_ResolvedTarget" data-uid="Grpc.Core.Channel.ResolvedTarget">ResolvedTarget</h4>
  286. <div class="markdown level1 summary"><p>Resolved address of the remote endpoint in URI format.</p>
  287. </div>
  288. <div class="markdown level1 conceptual"></div>
  289. <h5 class="decalaration">Declaration</h5>
  290. <div class="codewrapper">
  291. <pre><code class="lang-csharp hljs">public string ResolvedTarget { get; }</code></pre>
  292. </div>
  293. <h5 class="propertyValue">Property Value</h5>
  294. <table class="table table-bordered table-striped table-condensed">
  295. <thead>
  296. <tr>
  297. <th>Type</th>
  298. <th>Description</th>
  299. </tr>
  300. </thead>
  301. <tbody>
  302. <tr>
  303. <td><span class="xref">System.String</span></td>
  304. <td></td>
  305. </tr>
  306. </tbody>
  307. </table>
  308. <a id="Grpc_Core_Channel_ShutdownToken_" data-uid="Grpc.Core.Channel.ShutdownToken*"></a>
  309. <h4 id="Grpc_Core_Channel_ShutdownToken" data-uid="Grpc.Core.Channel.ShutdownToken">ShutdownToken</h4>
  310. <div class="markdown level1 summary"><p>Returns a token that gets cancelled once <code>ShutdownAsync</code> is invoked.</p>
  311. </div>
  312. <div class="markdown level1 conceptual"></div>
  313. <h5 class="decalaration">Declaration</h5>
  314. <div class="codewrapper">
  315. <pre><code class="lang-csharp hljs">public CancellationToken ShutdownToken { get; }</code></pre>
  316. </div>
  317. <h5 class="propertyValue">Property Value</h5>
  318. <table class="table table-bordered table-striped table-condensed">
  319. <thead>
  320. <tr>
  321. <th>Type</th>
  322. <th>Description</th>
  323. </tr>
  324. </thead>
  325. <tbody>
  326. <tr>
  327. <td><span class="xref">System.Threading.CancellationToken</span></td>
  328. <td></td>
  329. </tr>
  330. </tbody>
  331. </table>
  332. <a id="Grpc_Core_Channel_State_" data-uid="Grpc.Core.Channel.State*"></a>
  333. <h4 id="Grpc_Core_Channel_State" data-uid="Grpc.Core.Channel.State">State</h4>
  334. <div class="markdown level1 summary"><p>Gets current connectivity state of this channel.
  335. After channel has been shutdown, <code>ChannelState.Shutdown</code> will be returned.</p>
  336. </div>
  337. <div class="markdown level1 conceptual"></div>
  338. <h5 class="decalaration">Declaration</h5>
  339. <div class="codewrapper">
  340. <pre><code class="lang-csharp hljs">public ChannelState State { get; }</code></pre>
  341. </div>
  342. <h5 class="propertyValue">Property Value</h5>
  343. <table class="table table-bordered table-striped table-condensed">
  344. <thead>
  345. <tr>
  346. <th>Type</th>
  347. <th>Description</th>
  348. </tr>
  349. </thead>
  350. <tbody>
  351. <tr>
  352. <td><a class="xref" href="Grpc.Core.ChannelState.html">ChannelState</a></td>
  353. <td></td>
  354. </tr>
  355. </tbody>
  356. </table>
  357. <h3 id="methods">Methods
  358. </h3>
  359. <a id="Grpc_Core_Channel_ConnectAsync_" data-uid="Grpc.Core.Channel.ConnectAsync*"></a>
  360. <h4 id="Grpc_Core_Channel_ConnectAsync_System_Nullable_System_DateTime__" data-uid="Grpc.Core.Channel.ConnectAsync(System.Nullable{System.DateTime})">ConnectAsync(Nullable&lt;DateTime&gt;)</h4>
  361. <div class="markdown level1 summary"><p>Allows explicitly requesting channel to connect without starting an RPC.
  362. Returned task completes once state Ready was seen. If the deadline is reached,
  363. or channel enters the Shutdown state, the task is cancelled.
  364. There is no need to call this explicitly unless your use case requires that.
  365. Starting an RPC on a new channel will request connection implicitly.</p>
  366. </div>
  367. <div class="markdown level1 conceptual"></div>
  368. <h5 class="decalaration">Declaration</h5>
  369. <div class="codewrapper">
  370. <pre><code class="lang-csharp hljs">public Task ConnectAsync(DateTime? deadline = default(DateTime? ))</code></pre>
  371. </div>
  372. <h5 class="parameters">Parameters</h5>
  373. <table class="table table-bordered table-striped table-condensed">
  374. <thead>
  375. <tr>
  376. <th>Type</th>
  377. <th>Name</th>
  378. <th>Description</th>
  379. </tr>
  380. </thead>
  381. <tbody>
  382. <tr>
  383. <td><span class="xref">System.Nullable</span>&lt;<span class="xref">System.DateTime</span>&gt;</td>
  384. <td><span class="parametername">deadline</span></td>
  385. <td><p>The deadline. <code>null</code> indicates no deadline.</p>
  386. </td>
  387. </tr>
  388. </tbody>
  389. </table>
  390. <h5 class="returns">Returns</h5>
  391. <table class="table table-bordered table-striped table-condensed">
  392. <thead>
  393. <tr>
  394. <th>Type</th>
  395. <th>Description</th>
  396. </tr>
  397. </thead>
  398. <tbody>
  399. <tr>
  400. <td><span class="xref">System.Threading.Tasks.Task</span></td>
  401. <td></td>
  402. </tr>
  403. </tbody>
  404. </table>
  405. <a id="Grpc_Core_Channel_CreateCallInvoker_" data-uid="Grpc.Core.Channel.CreateCallInvoker*"></a>
  406. <h4 id="Grpc_Core_Channel_CreateCallInvoker" data-uid="Grpc.Core.Channel.CreateCallInvoker">CreateCallInvoker()</h4>
  407. <div class="markdown level1 summary"><p>Create a new <a class="xref" href="Grpc.Core.CallInvoker.html">CallInvoker</a> for the channel.</p>
  408. </div>
  409. <div class="markdown level1 conceptual"></div>
  410. <h5 class="decalaration">Declaration</h5>
  411. <div class="codewrapper">
  412. <pre><code class="lang-csharp hljs">public override CallInvoker CreateCallInvoker()</code></pre>
  413. </div>
  414. <h5 class="returns">Returns</h5>
  415. <table class="table table-bordered table-striped table-condensed">
  416. <thead>
  417. <tr>
  418. <th>Type</th>
  419. <th>Description</th>
  420. </tr>
  421. </thead>
  422. <tbody>
  423. <tr>
  424. <td><a class="xref" href="Grpc.Core.CallInvoker.html">CallInvoker</a></td>
  425. <td><p>A new <a class="xref" href="Grpc.Core.CallInvoker.html">CallInvoker</a>.</p>
  426. </td>
  427. </tr>
  428. </tbody>
  429. </table>
  430. <h5 class="overrides">Overrides</h5>
  431. <div><a class="xref" href="Grpc.Core.ChannelBase.html#Grpc_Core_ChannelBase_CreateCallInvoker">ChannelBase.CreateCallInvoker()</a></div>
  432. <a id="Grpc_Core_Channel_ShutdownAsyncCore_" data-uid="Grpc.Core.Channel.ShutdownAsyncCore*"></a>
  433. <h4 id="Grpc_Core_Channel_ShutdownAsyncCore" data-uid="Grpc.Core.Channel.ShutdownAsyncCore">ShutdownAsyncCore()</h4>
  434. <div class="markdown level1 summary"><p>Provides implementation of a non-virtual public member.</p>
  435. </div>
  436. <div class="markdown level1 conceptual"></div>
  437. <h5 class="decalaration">Declaration</h5>
  438. <div class="codewrapper">
  439. <pre><code class="lang-csharp hljs">protected override Task ShutdownAsyncCore()</code></pre>
  440. </div>
  441. <h5 class="returns">Returns</h5>
  442. <table class="table table-bordered table-striped table-condensed">
  443. <thead>
  444. <tr>
  445. <th>Type</th>
  446. <th>Description</th>
  447. </tr>
  448. </thead>
  449. <tbody>
  450. <tr>
  451. <td><span class="xref">System.Threading.Tasks.Task</span></td>
  452. <td></td>
  453. </tr>
  454. </tbody>
  455. </table>
  456. <h5 class="overrides">Overrides</h5>
  457. <div><a class="xref" href="Grpc.Core.ChannelBase.html#Grpc_Core_ChannelBase_ShutdownAsyncCore">ChannelBase.ShutdownAsyncCore()</a></div>
  458. <a id="Grpc_Core_Channel_TryWaitForStateChangedAsync_" data-uid="Grpc.Core.Channel.TryWaitForStateChangedAsync*"></a>
  459. <h4 id="Grpc_Core_Channel_TryWaitForStateChangedAsync_Grpc_Core_ChannelState_System_Nullable_System_DateTime__" data-uid="Grpc.Core.Channel.TryWaitForStateChangedAsync(Grpc.Core.ChannelState,System.Nullable{System.DateTime})">TryWaitForStateChangedAsync(ChannelState, Nullable&lt;DateTime&gt;)</h4>
  460. <div class="markdown level1 summary"><p>Returned tasks completes once channel state has become different from
  461. given lastObservedState (<code>true</code> is returned) or if the wait has timed out (<code>false</code> is returned).</p>
  462. </div>
  463. <div class="markdown level1 conceptual"></div>
  464. <h5 class="decalaration">Declaration</h5>
  465. <div class="codewrapper">
  466. <pre><code class="lang-csharp hljs">public Task&lt;bool&gt; TryWaitForStateChangedAsync(ChannelState lastObservedState, DateTime? deadline = default(DateTime? ))</code></pre>
  467. </div>
  468. <h5 class="parameters">Parameters</h5>
  469. <table class="table table-bordered table-striped table-condensed">
  470. <thead>
  471. <tr>
  472. <th>Type</th>
  473. <th>Name</th>
  474. <th>Description</th>
  475. </tr>
  476. </thead>
  477. <tbody>
  478. <tr>
  479. <td><a class="xref" href="Grpc.Core.ChannelState.html">ChannelState</a></td>
  480. <td><span class="parametername">lastObservedState</span></td>
  481. <td></td>
  482. </tr>
  483. <tr>
  484. <td><span class="xref">System.Nullable</span>&lt;<span class="xref">System.DateTime</span>&gt;</td>
  485. <td><span class="parametername">deadline</span></td>
  486. <td></td>
  487. </tr>
  488. </tbody>
  489. </table>
  490. <h5 class="returns">Returns</h5>
  491. <table class="table table-bordered table-striped table-condensed">
  492. <thead>
  493. <tr>
  494. <th>Type</th>
  495. <th>Description</th>
  496. </tr>
  497. </thead>
  498. <tbody>
  499. <tr>
  500. <td><span class="xref">System.Threading.Tasks.Task</span>&lt;<span class="xref">System.Boolean</span>&gt;</td>
  501. <td></td>
  502. </tr>
  503. </tbody>
  504. </table>
  505. <a id="Grpc_Core_Channel_WaitForStateChangedAsync_" data-uid="Grpc.Core.Channel.WaitForStateChangedAsync*"></a>
  506. <h4 id="Grpc_Core_Channel_WaitForStateChangedAsync_Grpc_Core_ChannelState_System_Nullable_System_DateTime__" data-uid="Grpc.Core.Channel.WaitForStateChangedAsync(Grpc.Core.ChannelState,System.Nullable{System.DateTime})">WaitForStateChangedAsync(ChannelState, Nullable&lt;DateTime&gt;)</h4>
  507. <div class="markdown level1 summary"><p>Returned tasks completes once channel state has become different from
  508. given lastObservedState.
  509. If deadline is reached or an error occurs, returned task is cancelled.</p>
  510. </div>
  511. <div class="markdown level1 conceptual"></div>
  512. <h5 class="decalaration">Declaration</h5>
  513. <div class="codewrapper">
  514. <pre><code class="lang-csharp hljs">public Task WaitForStateChangedAsync(ChannelState lastObservedState, DateTime? deadline = default(DateTime? ))</code></pre>
  515. </div>
  516. <h5 class="parameters">Parameters</h5>
  517. <table class="table table-bordered table-striped table-condensed">
  518. <thead>
  519. <tr>
  520. <th>Type</th>
  521. <th>Name</th>
  522. <th>Description</th>
  523. </tr>
  524. </thead>
  525. <tbody>
  526. <tr>
  527. <td><a class="xref" href="Grpc.Core.ChannelState.html">ChannelState</a></td>
  528. <td><span class="parametername">lastObservedState</span></td>
  529. <td></td>
  530. </tr>
  531. <tr>
  532. <td><span class="xref">System.Nullable</span>&lt;<span class="xref">System.DateTime</span>&gt;</td>
  533. <td><span class="parametername">deadline</span></td>
  534. <td></td>
  535. </tr>
  536. </tbody>
  537. </table>
  538. <h5 class="returns">Returns</h5>
  539. <table class="table table-bordered table-striped table-condensed">
  540. <thead>
  541. <tr>
  542. <th>Type</th>
  543. <th>Description</th>
  544. </tr>
  545. </thead>
  546. <tbody>
  547. <tr>
  548. <td><span class="xref">System.Threading.Tasks.Task</span></td>
  549. <td></td>
  550. </tr>
  551. </tbody>
  552. </table>
  553. </article>
  554. </div>
  555. <div class="hidden-sm col-md-2" role="complementary">
  556. <div class="sideaffix">
  557. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  558. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  559. </nav>
  560. </div>
  561. </div>
  562. </div>
  563. </div>
  564. <footer>
  565. <div class="grad-bottom"></div>
  566. <div class="footer">
  567. <div class="container">
  568. <span class="pull-right">
  569. <a href="#top">Back to top</a>
  570. </span>
  571. <span>Generated by <strong>DocFX</strong></span>
  572. </div>
  573. </div>
  574. </footer>
  575. </div>
  576. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  577. <script type="text/javascript" src="../styles/docfx.js"></script>
  578. <script type="text/javascript" src="../styles/main.js"></script>
  579. </body>
  580. </html>