Open ragavendra opened 1 year ago
No, that data doesn't isn't available from GrpcChannel
. I suggest you store the channel in a type that has the extra metadata you need so they can be passed around together.
Sure, thanks for the update. I am using a variable for now to be shared across various methods but might use a property as well if in case I have to share it across different pages or similar.
hi,
This question has already been asked here
Does the Grpc client have additional methods or properties to get the server name, port number of the server. Like, I can see one method
WithHost
innamespace Grpc.Core
. Also, this is in C# and might be needed in other languages too.I know the
GrpcChannel
type has it likechannel.Target
in the below snippet to get that information.I need something like
appCli.Target
or similar to get that info.PS - During debugging I could get that info from
(Grpc.Net.Client.Internal.HttpClientCallInvoker) appCli.Configuration.undecoratedCallInvoker
, however I could not use it in code asHttpClientCallInvoker
isinternal
orConfiguration
method was not accessible.The reason why I am asking is, say if I connect to n servers, then I need to maintain a key value for each client connection. With this feature or enhancement, I might not need to.
Apologies if this question is already answered!