OSDN Git Service

libpdx_uds: Allow to create Endpoint/ClientChannel from a socket pair
authorAlex Vakulenko <avakulenko@google.com>
Tue, 18 Apr 2017 21:37:20 +0000 (14:37 -0700)
committerAlex Vakulenko <avakulenko@google.com>
Wed, 19 Apr 2017 19:30:12 +0000 (12:30 -0700)
commit6eefa42d33bdddc3603211634f98937b00abc532
treebcc3ea681a2ccedc320a7013567f52bc9ef46631
parent7038c239728012789855f121e98baf0df0d81087
libpdx_uds: Allow to create Endpoint/ClientChannel from a socket pair

This is important to enable Service/Client operation in unit tests.
Being able to create a pair of Unix domain sockets and construct both
Service and Client so that they can talk to each other without having
to create a physical socket file is convenient.

This change makes it possible to create an instance of Endpoint and
ClientChannel classes based just on a pair of sockets (Endpoint does
take another socket to simulate the main endpoint FD to accept incoming
connection on, but it is not used for this, only the shutdown events
are received from that main socket. Endpoint uses the channel FD to
perform actual communication with the client).

Bug: 37443070
Test: `libpdx_uds_tests` pass
Change-Id: Ifa1a9d03b97bd90282a04715c2105ad37a8de936
libs/vr/libpdx_uds/client_channel_factory.cpp
libs/vr/libpdx_uds/ipc_helper.cpp
libs/vr/libpdx_uds/private/uds/client_channel_factory.h
libs/vr/libpdx_uds/private/uds/service_endpoint.h
libs/vr/libpdx_uds/service_endpoint.cpp