gRPC does connection management for you. If you don't have any active RPCs, it will not actively create connections for you.
You can force gRPC to create a connection eaglerly by calling ManagedChannel.getState(true), which requests the channel enter the ready state. Do note that in Java, class loading is done lazily, so you may be measuring connection time plus classload time if you only measure on the first connection. On Friday, August 17, 2018 at 9:17:16 AM UTC-7, [email protected] wrote: > > Hi, > > I am doing some experiment with gRPC java to determine the right gRPC call > type to use. > > here is my finding: > > creating 4 sets of StreamObservers (1 for Client to send request, 1 for > Server to send response), sending on the same channel is slightly after > than sending on 1 channel per stream. > I have already elimiated the time of creating initial tcp connection by > making a initial call to let the connection to be established, then start > the timer. > > I just wonder why this is the case? > > 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 [email protected]. To post to this group, send email to [email protected]. 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/7a7b0556-8c3a-49d5-a0ab-3ad4821b5602%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
