This CL migrates Tube from directly using a UnixSeqpacket to instead use a StreamChannel backed by UnixSeqpackets. This CL also migrates users of the old Tube::new(UnixSeqpacket) function to its renamed counterpart. Tests are added for new functionality. This CL enforces that the StreamChannel used by the Tube is backed by a UnixSeqpacket because the reading and writing behavior of a UnixStream is different, and it cannot guarantee the same multi-process concurrent-writers behavior that a UnixSeqpacket can. This is because the UnixStream does not send data as packets and the size cannot be queried, so two underlyig writes are required for each Tube write: one to send a header indicating message size, and one for the actual content of the sent data. These can be interleaved during concurrent writes, causing corruption of the Tube's data. This CL makes the Windows and Unix API closer to each other, with some differences remaining or added, including Tube::new_from_unix_seqpacket existing in Unix but necessarily not Windows. This migration (Tube from UnixSeqpacket to Stream) is intended to move the Unix Tube API closer to the Windows API, with the eventual goal of creating a platform-agnostic API for Tube. Bug: b:231641496 Change-Id: I2422e76b7efa5a20bc40a8d194f5f8390dc71438 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3818253 Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Reviewed-by: Noah Gold <nkgold@google.com> Tested-by: Clarissa Garvey <clarissagarvey@chromium.org> Commit-Queue: Clarissa Garvey <clarissagarvey@chromium.org> |
||
|---|---|---|
| .. | ||
| base_event_token_derive | ||
| src | ||
| .build_test_serial | ||
| Cargo.toml | ||