History log of /system/core/fastboot/socket.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
8bcce68f10c6bea50867430f876813d3a2f36968 05-Feb-2016 David Pursell <dpursell@google.com> fastboot: add Socket timeout detection.

UDP fastboot will require re-transmission in the case of datagrams
getting lost. This CL adds Socket functionality to easily distinguish
between a normal timeout and a socket failure.

I also found some Windows docs that indicate sockets may become
invalid after a call to recv() times out. This has never occurred in
my testing, but to be safe this switches the timeout implementation
to use select() instead of SO_RCVTIMEO.

Bug: http://b/26154914

(cherry picked from commit c742a7f17475e22739c09a5b19862b8d1ec6050a)

Change-Id: I339d42fc40d853ee48d1b457d06b67faf5799d91
/system/core/fastboot/socket.h
b34e4a06eeaaeaa42e0de6fdb44fb4202839b996 01-Feb-2016 David Pursell <dpursell@google.com> libcutils/fastboot: improve multi-buffer write.

Fixes libcutils multi-buffer write interface to be more friendly and
hooks into it from the fastboot Socket class.

Bug: http://b/26558551
Change-Id: Ibb3a8428fc379755602de52722c1260f9e345bc0
/system/core/fastboot/socket.h
c3a466960ff19bbf9b28b4d069dd0b872d4165d8 29-Jan-2016 David Pursell <dpursell@google.com> fastboot: socket testing improvements.

(This code was originally part of a huge fastboot CL but has been split
out to try to make the CLs a little more manageable).

More prep for fastboot TCP and UDP implementations. This CL adds a
SocketMock class that makes it easy to mock out network behavior so we
can unit test the TCP and UDP protocols.

Also uses the new libcutils socket_get_local_port() to avoid hardcoding
a server port in unit tests.

Bug: http://b/26157893.
Change-Id: I1ba10f31e98d7349313fc15f240383d63378a8db
/system/core/fastboot/socket.h
572bce29088521caf7f90c9fa66a8237a7674435 15-Jan-2016 David Pursell <dpursell@google.com> fastboot: use cutils socket functions.

Now that cutils has cross-platform socket functionality, we can
restructure fastboot to remove platform-dependent networking code.

This CL adds socket_set_receive_timeout() to libcutils and combines the
fastboot socket code into a single implementation. It also adds TCP
functionality to fastboot sockets, but nothing uses it yet except for
the unit tests. A future CL will add the TCP protocol which will use
this TCP socket implementation.

Bug: http://b/26558551

Change-Id: If613fb348f9332b31fa2c88d67fb1e839923768a
/system/core/fastboot/socket.h
815c7beae73bc0d13f14a94972175756aec1d4de 10-Dec-2015 David Pursell <dpursell@google.com> fastboot: implement UDP networking interface.

This CL creates a UdpSocket class that provides a simple unified
interface to send and receive UDP packets for all platforms. Nothing
uses this interface yet except for tests.

The eventual goal is to implement a UDP protocol for fastboot, but it
makes the code much simpler and more modular if we handle the low-level
networking here independently of our custom fastboot protocol.

Some of the Windows code is similar to adb. I'd like to create a
library to hold the common functionality, but it is going to be a
little delicate to separate out the features unique to adb (e.g. the
custom file descriptor system), and I don't want to risk breaking
something in adb before the holiday break, so I'm hoping to get this in
for now and merge them early next year.

Tests are included in this CL to exercise this functionality using a
loopback connection.

Bug: http://b/26154763.
Tests: `fastboot_test` loopback tests on Linux, Mac, and Windows 7.
Change-Id: I81d1b7ace8d864246b99f6c80b8e29f64b8aa375
/system/core/fastboot/socket.h