How to set deadline/timeout for streaming RPC

29 views
Skip to first unread message

Sidhartha Thota

unread,
Apr 10, 2019, 9:49:23 PM4/10/19
to grpc.io
Hi,

I am using GRPC v1.19 C++ version

I have a client-server mechanism where client streams data to server. So, using client-writer at client end. But if the server is down, the clientwriter creation is taking too much time (around 20 secs) to know that listener is not available.

"""
// created channel unique pointer 
// created stub unique pointer from channel
// Created context obj
deadline = now() + 2 // seconds
context.set_deadline(deadline);
ClientWriter writer = stub->send_data(&context, reply_message)
"""

How can I set deadline/timeout for Streaming RPC where the writer can unblock itself after N secs (where N is configurable).

Thanks,
Sid
Reply all
Reply to author
Forward
0 new messages