Closed Bug 1146822 Opened 5 years ago Closed 4 years ago
[Meta] Cleanup socket IPC code
B2G's socket IPC code under ipc/ needs a cleanup. * Remove |UnixSocketConsumer| |UnixSocketConsumer| has been replaced by |StreamSocket| and |ListenSocket|. The only user of |UnixSocketConsumer| is BlueZ's Bluetooth socket. We should either merge both classes or use |StreamSocket| as well. * New interface for |UnixSocketConnector| |UnixSocketConnector| creates socket file descriptors for specific use cases. It currently wraps respective POSIX functions and allows to set socket flags. But its interface is inconsistent. The new interface shall allow to create stream sockets and listen sockets, and allow to accept stream sockets from listen sockets. Ideally, |UnixSocketConnector| stores all relevant parameters. * Generic receive handlers |StreamSocket| forwards all received data to the main thread, but data can often be processed on the I/O thread or other helper threads. So this should be configurable. Users of stream sockets shall be able to set a consumer class for received data that implements the actual processing. * Implement |BluetoothDaemonConnection| on top of |StreamSocket| Both classes do the same works, but the implementations differ in details. |BluetoothDaemonConnection| is Bluetooth-specific, while |StreamSocket| is for generic data. It should be possible to implement |BluetoothDaemonConnection| on top of |StreamSocket|. * Maybe remove some internal threads NFC and RIL use helper threads for processing data. It might be possible to remove these helpers and run the code directly on the I/O thread. This would reduce overhead from cross-thread IPC.
I intend to work on this bug during Q2.
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #0) > B2G's socket IPC code under ipc/ needs a cleanup. > > * Remove |UnixSocketConsumer| Has been resolved in bug 1154281.
> * New interface for |UnixSocketConnector| Landed in bug 1161020
> * Generic receive handlers Landed in bug 1166638 and bug 1167207. The multi-threading part of this task needs a different approach.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.