summaryrefslogtreecommitdiff
path: root/fastboot/socket.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Include sys/select.h for fd_setColin Cross2021-08-161-0/+4
| | | | | | | | | socket.cpp fails to compile on musl with a missing definition of fd_set. Include sys/select.h for the definition. Bug: 190084016 Test: m USE_HOST_MUSL=true fastboot Change-Id: I095a56381a85981f42444f4c39ae8e7786d8640f
* fastbootd: Support TCP protocol.Hongguang Chen2020-05-131-1/+3
| | | | | | | | | | | | The current fastbootd only supports USB protocol. But some Android TV devices are built without USB port. The fastbootd cannot be used on those ATV devices due to it. This change adds TCP protocol for such devices and fastbootd.protocol property is added to control which protocol to use. BUG: 152544169 Test: manual test. Change-Id: Idc391e677eb6a1880036419ba5f6c4160e8dbcbc
* Fix google-explicit-constructor warnings.Chih-Hung Hsieh2016-04-291-1/+1
| | | | | Bug: 28341362 Change-Id: I4504e98a8db31e0edcbe63c23f9af43eb13e9d86
* fastboot: add Socket timeout detection.David Pursell2016-02-051-14/+36
| | | | | | | | | | | | | | 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
* libcutils/fastboot: improve multi-buffer write.David Pursell2016-02-031-14/+56
| | | | | | | | 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
* fastboot: socket testing improvements.David Pursell2016-02-021-0/+14
| | | | | | | | | | | | | | | (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
* fastboot: use cutils socket functions.David Pursell2016-01-211-0/+212
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