History log of /system/core/fastboot/socket_mock.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c742a7f17475e22739c09a5b19862b8d1ec6050a 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
Change-Id: Id7b598f8aea5df1a3676d24702b489042d5f9e3a
/system/core/fastboot/socket_mock.h
2c094f79836d7defb6114e59b6412157658c0f90 03-Feb-2016 David Pursell <dpursell@google.com> fastboot: fix SocketMock send failures.

Fixes SocketMock::ExpectSendFailure() to allow unit testing of errors
during send, and adds tests for ExpectSendFailure() and
AddReceiveFailure().

Also adds missing tests to make sure ReceiveAll() continues to read
until failure or all bytes have been read.

Bug: http://b/26157893
Change-Id: I67e7d6de8e8ec4a3b62a6b7d7217f7530862edf7
/system/core/fastboot/socket_mock.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_mock.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_mock.h