[grpc-io] Re: Set keepalive in C# client

2017-12-04 Thread wangjunwei87
I encounter the same problem, and I don't know how to deal with it.

On Sunday, July 23, 2017 at 3:08:14 AM UTC+8, koen.vl...@gmail.com wrote:
>
>
> I'm using the gRPC client in C# and using a long-lived duplex stream. 
> However, the TCP connection is closed at some time and therefore I would 
> like to use a keepalive in the client. The server (written in Go) is 
> already configured correctly for the keepalive and already tested with 
> clients written in Go.
>
> I use the following code to set a keepalive for 5 minutes and also to 
> enable tracing for viewing all incoming/outgoing bytes.
>
> Environment.SetEnvironmentVariable("GRPC_TRACE", 
> "tcp,channel,http,secure_endpoint");
> Environment.SetEnvironmentVariable("GRPC_VERBOSITY", "DEBUG");
>
> var callCredentials = CallCredentials.FromInterceptor(Interceptor());
>
> var roots = Encoding.UTF8.GetString(Resources.roots);
>
> Channel = new Channel(address, ChannelCredentials.Create(new 
> SslCredentials(roots), callCredentials), new[]
> {
> new ChannelOption("grpc.keepalive_time_ms", 5 * 60 *  1000), // 5 
> minutes
> });
>
> await Channel.ConnectAsync(DateTime.UtcNow.AddSeconds(5));
>
> However, in the log there are no bytes sent at 5 minutes and the 
> connection is closed as I can no longer send/receive messages via the same 
> stream after the stream has been idle for some time.
>
> How would I properly enable keepalive?
>

-- 
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/447a0251-e198-437c-8095-4e2a2bcbdc14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [grpc-io] grpc c++ stream blocked when connect to an unavailable server

2017-12-04 Thread csenanda
Hi,
Can you help me understand how did you overcome this issue.  I too have a 
client that invokes streaming rpc and it gets blocked in ClientReader::Read.
I cant set a timeout as it would mean the rpc needs to be invoked again 
after the timeout.

I need a way to reestablish the server connection if client gets blocked in 
ClientReader::Read.  I cannot read the connection state as the call is 
blocked.
However Read fails and gets unblocked if
- I kill the server process or unplug the connection between client and 
server
But the client gets blocked indefinitely when the server is 
shutdown/powered off.

My code goes like this
ClientContext context;
std::unique_ptr stub_ = Consumer::NewStub(channel);
ThreadEventReader = stub_->GetDataStream(, Filter);  //rpc call
// blocked read - until stream closed
while (ThreadEventReader->Read())
{
cout << "UpdateStream: " << StreamedData.displayvalue() << 
endl;
}

On Wednesday, 25 May 2016 10:29:57 UTC-5, yangya...@gmail.com wrote:
>
> Hi, my version has fail_fast, and I checked the state of channel. When 
> server is shutdown, the state is GRPC_CHANNEL_CONNECTING, which helps me 
> know server is unavailable.
> Thank you!
>

-- 
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/6655a757-e39a-43c0-8bac-a556170d5eae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] Re: Metadata from server to client

2017-12-04 Thread chilladx
I finally found my 
way: https://github.com/grpc/grpc-go/blob/master/Documentation/grpc-metadata.md

So basically, grpc.SetHeader() + grpc.SendHeader() and grpc.SetTrailer() 
are totally what I was looking for. On the client side, grpc.Header() and 
grpc.Trailer() functions need to be passed to the RPC call, and their 
argument is a metadata.MD object to be filled.

Le lundi 4 décembre 2017 15:32:15 UTC+1, chil...@gmail.com a écrit :
>
> Hi all,
>
> i'm trying to use the context metadata aside from the pure RPC 
> communication between my client and server.
>
> In this code example (
> https://gitlab.com/pantomath-io/demo-grpc/blob/add-auth), I have a client 
> adding a login/password in the metadata sent to the server. This latest 
> uses an UnaryInterceptor to extract the metadata from the context, and to 
> process the RPC call (or block it).
>
> Now, I'd like the server to inject metadata in the *response* to the 
> client, and the client to read it (for instance, the server could inject a 
> serial number in the response).
>
> I'm quite confused on how to do that:
> - do the client and server share the same context? (ie the server should 
> set the metadata in the context it knows, and the client would read it from 
> there?)
> - are SetHeader() [1] and SetTrailer() [2] functions made just for that? 
> If so, is it only in the case of stream (as opposed to RPC calls)?
> - is there any mechanism to make this exchange systematic (like the 
> Interceptor)?
>
> Many thanks,
> julien
>
>
> [1] https://godoc.org/google.golang.org/grpc#SetHeader
> [2] https://godoc.org/google.golang.org/grpc#SetTrailer
>

-- 
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/6592c34e-bb98-4705-a34f-55588e26072a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] Custom Transport Security

2017-12-04 Thread aajtodd
Is there a way to set custom transport security other than SSL?

I saw this post https://github.com/grpc/grpc/issues/9985 but it wasn't 
particularly helpful.


I have browsed through the source of gRPC a bit and see what appears to be 
a generic handshake mechanism that looks promising but it would take a 
while to comprehend. If I wanted to use something other than SSL for 
encryption (e.g. a key exchange algorithm) how would I go about doing it? 
Follow up question, can a custom handshake implementation be used with the 
C++ abstractions?

Thanks!

-- 
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/f39d1622-f8fb-4d28-b926-d232919d3bc3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] Re: Getting "all SubConns are in TransientFailure" sending to local grpc service.

2017-12-04 Thread yufeng
Hi Paul,

can i ask did you have solved the issue. i have the same problem..

On Tuesday, November 14, 2017 at 5:36:19 AM UTC+8, Paul Breslin wrote:
>
>
> I'm running local grpc services under Docker for Mac. All has been fine 
> but today I started getting intermittent failures:
> rpc error: code = Unavailable desc = all SubConns are in TransientFailure
> when my test code sends a message to one of the services. The test code 
> also runs inside a docker container.
>
> Sometime restarting the docker daemon would make this go away but for some 
> reason the problem is now happening consistently.
>
> I've tried updating to the latest stable Docker for Mac and updating to 
> the current grpc release code.
>
> I'm stuck - not sure what to try next. We're currently using: go version 
> go1.8.3 linux/amd64
>
> Suggestions are welcome.
>

-- 
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/7b76a979-1a5f-443a-a447-6db13a9238e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] Re: gRPC Java 1.8.0 released

2017-12-04 Thread mfirry
This is great!

How "safe" is it to upgrade from 1.6 to 1.8?

Should I take something into account?

Thanks

On Wednesday, November 22, 2017 at 7:11:01 PM UTC+1, Eric Anderson wrote:
>
> gRPC Java 1.8.0 is now released and available on Maven Central.
>
> v1.9.0 is scheduled for January 2nd, but the holidays will likely delay 
> the release some. Delays will not impact later releases; v1.10 would still 
> be scheduled for 6 weeks from January 2nd.
>
> Dependencies
>
>- core: Now using io.opencensus:opencensus-api and 
>io.opencensus:opencensus-contrib-grpc-metrics instead of 
>com.google.instrumentation:instrumentation-api for stats and tagging. The 
>gRPC Monitoring Service continues to use instrumentation-api.
>- examples: In Android example, bump minSdkVersion to 14. Google Play 
>Services, which is used for TLS, bumped their minimum supported version
>
> API Changes
>
>- core: Removed deprecated load balancer and name resolver APIs. This 
>includes LoadBalancer.handleResolvedAddresses(), 
>LoadBalancer.Helper.updatePicker(), NameResolver.Listener.onUpdate(), 
>ResolvedServerInfo, and ResolvedServerInfoGroup
>- stub: Added @DoNotMock annotations to AbstractStub, 
>CallStreamObserver, ClientCallStreamObserver, ServerCallStreamObserver. 
>The normal gRPC implementations of these classes should be used in tests
>- codegen: Removed enable_deprecated protoc plugin option (#3541 
>). These deprecated APIs 
>pre-date 1.0 and were off by default
>- codegen: Added methods for accessing generated method descriptors. 
>This replaces the METHOD_FOO constants with static getFooMethod() methods. 
>The constants are deprecated and will be removed in a future release. Once 
>the constants are removed, this change will allow the descriptors (and the 
>messages they reference) to be lazily created which can dramatically 
>decrease class initialization time and allows unused RPC messages to be 
>removed by Proguard.
>- testing: TestMethodDescriptors.noopMethod() is deprecated in favor 
>voidMethod() or test services. The simple service in 
>grpc-testing-proto should work in most cases where voidMethod()is 
>insufficient
>- testing: Marked DeadlineSubject experimental. It is planned for 
>removal to ease future Guava dependency issues with Truth. It could be 
>moved into its own artifact, but best as we can tell nobody is using it. 
> If 
>you're using it, please file an issue so we can be made aware
>- testing: Deprecated StreamRecorder. It will be removed in a future 
>release. The class is *very* old (since the beginning in OSS) and was 
>used in internal tests before there were blocking stubs. Most users should 
>use blocking stubs instead. To use properly, you must know the class's 
>implementation; if you liked it, copy the code to your own codebase
>- testing: Deprecated TestUtils.recordServerCallInterceptor(). It will 
>be removed in a future release. It has no known use cases for normal users
>- The (unreleased) Thrift support has been removed from this 
>repository. It can be found athttps://github.com/grpc-ecosystem/grift
> instead
>
> New Features
>
>- The Cronet transport is open-sourced. Cronet is Chrome's network 
>stack made into a library for mobile. We do not provide a build file nor 
>are we making binaries, but if you're interested it shouldn't be too hard 
>to build manually
>- context: CancellableContext now implements Closeable (#3607 
>). close() is an alias 
>for cancel(null). This should make it more clear that the context 
>needs to be cancelled/closed, while also enabling try-with-resources
>- core: Attributes.Builder.build() may now be called multiple times
>- core: Added first-class drop support for load balancers via 
>PickResult.withDrop(Status). This is necessary if the LB wants to fail 
>waitForReady RPCs to shed load
>- core: Added MethodDescriptor.getSampledToLocalTracing()/
>Builder.setSampledToLocalTracing to permit per-method stats keeping 
>memory overhead (#3627 ). 
>The option is to prevent unbounded memory overhead when 
> dynamically-created 
>MethodDescriptors are used and is enabled in the generated code.
>- core: Added resetConnectBackoff() method to ManagedChannel. This can 
>be used when the OS notifies your application that the network has become 
>available
>- stub: Added stub.withExecutor(Executor). This was already available 
>on CallOptions and can be used to specify a call-specific executor to use 
>for callbacks
>- testing: Added TlsTesting.loadCert as an alternative to deprecated 
>TestUtils.loadCert. The TlsTesting version returns an InputStream instead 
>of 

[grpc-io] Support for mp3 music playback from radio station or 3r party music websites

2017-12-04 Thread Abbhishek Misra
Hello All,

Does https://github.com/googlesamples/assistant-sdk-cpp
or any other example support mp3 music playback from radio station or 3r 
party music websites?

I tried assistant-sdk-cpp, it some times pays any song from its own choice 
completely disregarding request that I make. 
Is there sufficient infrastructure in assistant frame work itself to do 
this?

Regards
Abhishek Misra

-- 
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/e9d07443-5b89-49b6-9ba1-5369af699e18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.