<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>xin9le</author_name>
  <author_url>https://blog.hatena.ne.jp/xin9le/</author_url>
  <blog_title>xin9le.net</blog_title>
  <blog_url>https://xin9le.hatenablog.jp/</blog_url>
  <categories>
    <anon>gRPC</anon>
    <anon>Web API</anon>
  </categories>
  <description>gRPC はサーバーとクライアントが常時コネクションを張っている状態です。このコネクションが切断されたタイミングを検知して後処理や再接続処理をしたい、というのはよくパターンかと思います。実は、生の gRPC で切断検知をするのは実はかなり面倒です。MagicOnion はそのあたりを上手くラップ*1し、扱いやすい形として提供してくれています。 今回は、それらを利用した切断検知と再接続の手法について見ていきます。 クライアント側で切断を検知 例えば、サーバーがダウンしたりなどしてコネクションが切断されたことをクライアント側で検知する方法は以下のようにします。 static async Task …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fxin9le.hatenablog.jp%2Fentry%2F2018%2F03%2F27%2F023807&quot; title=&quot;gRPC / MagicOnion 入門 (17) - 切断検知と自動再接続 - xin9le.net&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-03-27 02:38:07</published>
  <title>gRPC / MagicOnion 入門 (17) - 切断検知と自動再接続</title>
  <type>rich</type>
  <url>https://xin9le.hatenablog.jp/entry/2018/03/27/023807</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
