question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to create grpc server code with cronet?

See original GitHub issue

I want to create a grpc server code with cronet, and use android as client with cronet to call rpc interface, but i cannot find any server code in grpc-java branch, just only have som code for client as below, could you help? thanks

`import io.grpc.cronet.CronetChannelBuilder; import org.chromium.net.ExperimentalCronetEngine;

ExperimentalCronetEngine engine = new ExperimentalCronetEngine.Builder(context /* Android Context */).build(); ManagedChannel channel = CronetChannelBuilder.forAddress(“localhost”, 8080, engine).build();`

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ejona86commented, Nov 21, 2022

Use it like a normal server builder. So something like this: https://github.com/grpc/grpc-java/blob/806fb84a57216963e94e873bd86c16dda60a7745/examples/src/main/java/io/grpc/examples/helloworld/HelloWorldServer.java#L38-L41

But replace ServerBuilder with OkHttpServerBuilder.

(At some point we’ll hook up OkHttpServerBuilder into the ServerBuilder.forPort() API, so you could just use the ServerBuilder API. But we haven’t done that as of yet.)

1reaction
sanjaypujarecommented, Nov 16, 2022

Is there any sample code can build server on Android eg: OkHttpServerBuilder

I want to test android RPC betwwen two android device

This one https://github.com/grpc/grpc-java/blob/master/interop-testing/src/test/java/io/grpc/testing/integration/Http2Test.java#L102

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build client-server applications with gRPC - Android Developers
gRPC is a modern, open-source, high-performance RPC framework that can run in any environment. It can efficiently connect services in and ...
Read more >
Chapter 4, gRPC: Under the Hood - O'Reilly
You use the service definition to generate either server- or client-side code for the language of your choice. All the low-level communication details...
Read more >
gRPC Python implementation from scratch | by Vikesh Yadav
gRPC is designed to make the client believe that the server is ... proto run the following command to let gRPC auto-generate code...
Read more >
io.grpc.cronet.CronetChannelBuilder.java Source code
Here is the source code for io.grpc.cronet. ... Executor executor); } /** Creates a new builder for the given server host, port and...
Read more >
cronet - platform/external/grpc-grpc-java - Git at Google
Using Cronet with gRPC requires manually integrating the gRPC code in this ... This lets your Android app make RPCs using the same...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found