title: How to inspect clients that are connected to a GRPC server
body: <p>To provide better debugging information for my GRPC server/client setup, I am trying to find an API for <code>grpc.server</code> that allows me to inspect what clients are connected to the server.</p>
  
  <p>The most promising question I have found is <a href="https://stackoverflow.com/a/41515454/1333978">question, which gives a starting point on how to do this in Java GRPC</a>. However, the Java API doesn't exist in the Python GRPC implementation.</p>
  
  <p>So far, I keep track of unique peers using the <code>context.peer()</code> method in a <code>grpc.ServicerContext</code>. If a peer hasn't sent a request in a while (a timeout I set to 2 seconds) I assume the client has disconnected. </p>
  
  <p>I've started looking at the python-grpc source code but I haven't made any headway. </p>
  
  <p>If anyone knows of a similar API in python I could use, that would be appreciated! Even an internal API would be sufficient for these debugging needs.</p>