Closed
Bug 1146822
Opened 10 years ago
Closed 10 years ago
[Meta] Cleanup socket IPC code
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: tzimmermann, Assigned: tzimmermann)
References
Details
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.
| Assignee | ||
Comment 1•10 years ago
|
||
I intend to work on this bug during Q2.
| Assignee | ||
Comment 2•10 years ago
|
||
(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.
| Assignee | ||
Comment 3•10 years ago
|
||
> * New interface for |UnixSocketConnector|
Landed in bug 1161020
| Assignee | ||
Comment 4•10 years ago
|
||
> * Generic receive handlers
Landed in bug 1166638 and bug 1167207. The multi-threading part of this task needs a different approach.
| Assignee | ||
Comment 5•10 years ago
|
||
Done.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•