title: Kotlin / Java grpc check connection status
body: <p>I am writing one app in Kotlin to connect to grpc server and fetch data.</p>
  
  <p>Below is my code snippet :</p>
  
  <pre><code>channel = ManagedChannelBuilder.forTarget("localhost:25001")
                  .usePlaintext()
                  .build()
  
  stub = hello.HelloGrpc.newBlockingStub(channel)
  </code></pre>
  
  <p>My GRPC Server is <strong>down</strong>, but i can see value for both variable as below : </p>
  
  <pre><code>for channel = channelManagedChannelOrphanWrapper{delegate=ManagedChannelImpl{logId=1, target=localhost:25001}}
  for stub = channelhello.HelloGrpc$HelloBlockingStub@19b843ba
  </code></pre>
  
  <p>I am confused, how to check if connection is not active.</p>
  
  <p>For now, i have added try catch statement while fetching value, which is throwing me an error </p>
  
  <blockquote>
    <p>UNAVAILABLE: io exception</p>
  </blockquote>
  
  <p>Just wondering, Is there any way by which I can check my connection status and try to re-connect for broken connection.</p>