Why endpoint_pair are piped?

16 views
Skip to first unread message

dharam...@cypress.com

unread,
Feb 21, 2018, 12:32:19 AM2/21/18
to grpc.io

Hi,
I've a pretty basic question regarding the implementation of grpc_iomgr_create_endpoint_pair( ).

For Posix/Windows environment, it returns a pair of endpoints(client & server).

My questions , in general, is about understanding the purpose of an end-point pair? Main confusion is around these endpoints getting internally piped before being returned ?

If end-point/sockets represent the remote device, should it be piped/connected to another local socket? 


Br,
Dharam

Ken Payson

unread,
Feb 21, 2018, 1:54:03 PM2/21/18
to grpc.io
Behind the scenes, grpc_iomgr_create_endpoint_pair( ) creates a unix socketpair instead of the standard connected socket.

The endpoint pair is already piped when it is returned.  Socketpairs can be a useful alternative to standard sockets if your client/server are both in the same process.

dharam...@cypress.com

unread,
Feb 22, 2018, 3:19:32 AM2/22/18
to grpc.io
Thanks Ken.
So, it is probably useful for quickly prototyping application logic or write some quick tests for the new applications ?
As a piped pair of endpoints will eliminate the need of a separate external grpc server(or client).
Reply all
Reply to author
Forward
0 new messages