diff options
author | Josh Gao <jmgao@google.com> | 2018-04-03 14:37:11 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2018-05-23 11:26:04 -0700 |
commit | 7c738cdb53061f89605abc8243236a2bd783eeec (patch) | |
tree | 2d39f1b96b8f759d667e07bc2e6fbdca8f23390c /libcutils/sockets_unix.cpp | |
parent | 9da1a9118bbbff1d8dab8b15449d23e6e512f9e3 (diff) |
adb: add IOVector.
An IOVector is a collection of immutable reference counted blocks which
can have its head detached at an arbitrary index. This is extremely
useful for implementing packet-framed protocols like adb on top of a
stream protocol like TCP: a stream reader can read blocks, append them
to the end of the IOVector, and then pull packets off of the front.
This also lends itself naturally towards scatter/gather I/O, which will
enable us to read data from disk and send it across the wire with a
theoretical minimum number of copies in USB, and one extra copy over
TCP.
Since this is basically a generalization of std::deque<Range>, delete
Range and replace its uses with IOVector.
Test: adb_test
Test: wine adb_test.exe
Change-Id: I06561ad0bb25a3a51b378b61d257b5b04b41d9c4
Diffstat (limited to 'libcutils/sockets_unix.cpp')
0 files changed, 0 insertions, 0 deletions