[grpc-io] Re: What is the behaviour of grpc::ServerContext::IsCancelled()

2018-04-05 Thread Okke Hendriks
Thank you,

Indeed it seems to be the case that it is more like IsFailed() instead of 
IsCanceled().

If i examine the *grpc_call* 

 
struct, (accessible through the c++ API 
,
 
but using it will require including non-public core lib headers? Which i do 
not want to do.) it has an *grpc_call_final_info* member defined here 

. 
Which includes a *grpc_status_code*  and error message, I do not know if 
these are set on the server side, but this might be something to expose on 
the C/C++ API?


On Wednesday, April 4, 2018 at 7:25:14 PM UTC+2, ncte...@google.com wrote:
>
> Taking a look at the C API, it looks like IsCancelled() will be true "if 
> the call failed in any way". See here 
> 
> .
>
> There is not an API method to determine more info about error, but that 
> should be available by examining logs. (setting GRPC_VERBOSITY=debug and 
> GRPC_TRACE=all)
>
> On Wednesday, March 28, 2018 at 11:45:36 AM UTC-7, Okke Hendriks wrote:
>>
>> Hello,
>>
>> I am using the sync grpc C++ API v1.10.0.
>>
>> Could someone explain to me what the exact behaviour of IsCancelled() 
>> 
>>  is?
>>
>> Does it evaluate to true if and only if the client sends a TryCancel() 
>> which was received by the server? 
>> Or also if a call/stream closed due to another reason (socket closed, OS 
>> error, etc.)?
>>
>> If it is NOT the case that it only returns true when a client cancelled, 
>> is there a way to find the reason of the cancellation, aka the status?
>>
>> Kind regards,
>>
>> Okke Hendriks
>>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/505433e8-0b74-44f0-9895-d097a240b786%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [grpc-io] Re: reference to MetaData object in grpc service method

2018-04-05 Thread 'Carl Mastrangelo' via grpc.io
Can you give a snippet of code showing what you are trying to do but can't?

On Tuesday, April 3, 2018 at 9:51:13 AM UTC-7, Mahesh Kanote wrote:
>
> I wanted to access custom headers sent by client as meta data. I am able 
> to do it using context object in server interceptor. 
>
> On Tue, 3 Apr 2018, 22:12 'Carl Mastrangelo' via grpc.io, <
> grp...@googlegroups.com > wrote:
>
>> gRPC Java does not expose all the headers, because some of them are gRPC 
>> specific.  What headers did you want to access?
>>
>> On Saturday, March 31, 2018 at 4:15:21 AM UTC-7, Mahesh Kanote wrote:
>>>
>>> Hi,
>>>
>>> I have question about getting MetaData in grpc service method. By 
>>> Implementing io.grpc.ServerInterceptor its possible to get reference of 
>>> MetaData sent by client. But, is there any way we can get reference to 
>>> MetaData object in grpc service method? Something like HttpServletRequest 
>>> and HttpServletResponse in case of RestControllers.
>>>
>>> Thanks,
>>> Mahesh
>>>
>> -- 
>> 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 post to this group, send email to grp...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/grpc-io.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/grpc-io/92935121-afc4-4e5f-beda-e945b75c78c9%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/598963a1-2a16-4ec6-a57a-0462acaf62c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.