How to implement dynamic endpoint selector?

64 views
Skip to first unread message

Sergey Shalnov

unread,
Sep 5, 2016, 5:27:59 AM9/5/16
to grpc.io
Hi,
I would like to understand how to select gRPC endpoint dynamically. As I can see, chttp2 uses tcp_endpoint for this time only.
Should I add some additional fields into chttp2 metadata to establish connection with desired endpoint properly?
Thank you
Sergey

Nicolas Noble

unread,
Sep 7, 2016, 1:31:45 PM9/7/16
to grpc.io
Transports need to be supplied the proper endpoint, and not the other way around. So the idea is that you can supply your own endpoints to the C core if you want when calling into grpc_create_chttp2_transport. See for example channel_create.c - you could write your own channel code that'll spawn whichever endpoint you want and then plumb into chttp2.

Sergey Shalnov

unread,
Sep 7, 2016, 11:17:29 PM9/7/16
to grpc.io
Nicolas,
Thank you for the answer

Currently, chttp2 transport operates with only one tcp_endpoint. What if I implemented second endpoint, based on other network HW (Infiniband). In this case, chttp2 could operate with two different endpoints and have to select proper endpoint for incoming connection (on server side). What is why I asked about "additional fields" in http.
I would understand how to implement endpoint selector algorithm properly. I would provide the code which allow gRPC server works with tcp_endpoint clients and ucx_endpoint (my endpoint) clients simultaneously.

Sergey
Reply all
Reply to author
Forward
0 new messages