How can GRPC server know if client is down when data is streaming from client to server .

44 views
Skip to first unread message

Sidhartha Thota

unread,
May 9, 2019, 2:22:00 PM5/9/19
to grpc.io
Hi Team,

I have a following situation. I have Java GRPC server listening for client data. Client opens the connection and streams data to Server. It is unidirectional stream from client to server or Client side streaming use case.

Client is able to know when server is down (when the write is failed) but how can GRPC server know if a client is down? In precise, is any server callback is called if a connected client is down? or is there any other way, I can keep track of my clients from server end.

Next, how can server know the client details which sent the data? Because, onNext() [while listening to client data at server] method do not have any info to know which client sent the corresponding data.

--
Thanks,
Sidhartha Thota.

Carl Mastrangelo

unread,
May 21, 2019, 1:49:41 PM5/21/19
to grpc.io
You can tell if a client is done using ServerTransportFilter, but you cannot use it to associate if a particular RPC is associated with the transport.  You can only tell if a client RPC is done (successful or not) using the StreamObserver api (and sub classes), or using the ServerCall.Listener API directly.
Reply all
Reply to author
Forward
0 new messages