how do i normally close a grpc channel?

32 views
Skip to first unread message

Elhanan Maayan

unread,
Jul 28, 2019, 5:27:35 PM7/28/19
to grpc.io

hi, 
assuming that i have a streaming request. how would i close a channel? 

if i configure a deadline attempting to use channel using channel.shutdown().awaitTermination(15, TimeUnit.SECONDS);  won't work until i use shutdown now.

otherwise it will keep sending packets. 
if i use  mListenContext = Context.current().withCancellation(); i will get an error cancelled without reason, i've been trying to search grpc code, and there seems to a gracefullCloseCommand but i don't know how to use it.

Jihun Cho

unread,
Jul 29, 2019, 9:16:09 PM7/29/19
to Elhanan Maayan, grpc.io
after graceful shutdown, the channel won't accept incoming traffic. but, it will wait until all the streams are finished.
can you check if there is any active streams? 


--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/c7207d76-7297-4bda-9632-4a1b661881de%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages