[libcamera-devel,v2,0/3] libcamera: ipc: unix: Add a IPC mechanism based on Unix sockets
mbox series

Message ID 20190630162514.20522-1-niklas.soderlund@ragnatech.se
Headers show
Series
  • libcamera: ipc: unix: Add a IPC mechanism based on Unix sockets
Related show

Message

Niklas Söderlund June 30, 2019, 4:25 p.m. UTC
Hello,

This series adds an IPC mechanism to pass data and file descriptors
between two processes. The interface is asynchronous and bi-directional.

* Changes since v1
- Add a bugfix for Timer which prevented the test case to function 
  properly.
- Add destructor to close the IPC channel.
- Rename attach() to bind().
- Add isBound() mehtod.
- Rework signal emitted for incoming data to Signal<IPCUnixSocket *> 
  readyRead.
- Make payload argument in send() const at the cost of adding a 
  const_cast().
- Dropped unused master_ property.
- Updated documentation, thanks Laurent!
- Add a call() method in the test case to simplify test logic.
- Use dup() instead of opening the same file path multiple times.

* Changes since RFC
- Switch to an event notifications and signals for the ingress code
  path, making the interface asynchronous.
- Removed any protocol helpers in the IPC object, a protocol should be
  implemented on top of the IPC.
- Added documentation.
- Switched to SOCK_DGRAM.
- Send both data and file descriptors in the same sendmsg().
- Fixed spelling and silly errors in the code.
- Merged test case in a single binary.

Niklas Söderlund (3):
  libcamera: timer: Stop timer when it is deleted
  libcamera: ipc: unix: Add a IPC mechanism based on Unix sockets
  test: ipc: unix: Add test for IPCUnixSocket

 include/libcamera/timer.h              |   1 +
 src/libcamera/include/ipc_unixsocket.h |  57 ++++
 src/libcamera/ipc_unixsocket.cpp       | 312 ++++++++++++++++++++
 src/libcamera/meson.build              |   2 +
 src/libcamera/timer.cpp                |   5 +
 test/ipc/meson.build                   |  12 +
 test/ipc/unixsocket.cpp                | 390 +++++++++++++++++++++++++
 test/meson.build                       |   1 +
 8 files changed, 780 insertions(+)
 create mode 100644 src/libcamera/include/ipc_unixsocket.h
 create mode 100644 src/libcamera/ipc_unixsocket.cpp
 create mode 100644 test/ipc/meson.build
 create mode 100644 test/ipc/unixsocket.cpp