summaryrefslogtreecommitdiffstats
path: root/include/sysutils/SocketClient.h
Commit message (Collapse)AuthorAgeFilesLines
* libsysutils: Add iovec/runOnEachSocketMark Salyzyn2014-01-221-12/+17
| | | | | | | | | | | | | | | | | | SocketClient: * Replace sendDataLocked with sendDataLockedv which takes an iovec. * Add a version of sendData, sendDatav, which takes an iovec. * do not preserve iovec content through sendDatav SocketListener: * Add runOnEachSocket, which allows to to specify a SocketClientCommand to run individually on each socket. This allows you to do broadcast-like actions customized for each individual socket. * Client safe list reference counting for sendBroadcast & runOnEach Socket Signed-off-by: Nick Kralevich <nnk@google.com> Signed-off-by: Mark Salyzyn <salyzyn@google.com> Change-Id: I716f89c01b4cb7af900045c7e41fac1492defb06
* Add ability to quote responses as needed.Robert Greenwalt2012-04-201-0/+3
| | | | | | | | It's up to the protocol to know when quotes are required. In the future the response should probably all be binary blobs with lengths. bug:6353048 Change-Id: I3f9b48ab0f4e6746d75cdc9c0c84d33f38f63661
* Fix pointer arith.Robert Greenwalt2012-03-091-6/+4
| | | | | | | | | Sending 3digit code, null, binary-length and data. Current code sends 3digit code, space, null, binary-length, binary-data. The space should not be sent. Change-Id: I1df00a3e70805b39b6105966c7f3c613461a6858
* Add a utility function to send a code + binary msgSelim Gurun2012-03-071-1/+18
| | | | | | | | | Add a utility function to SocketClient to send a c-string code prepended to a binary message. This is necessary to be able to send a binary message while keeping compatible with underlying text-based protocol. Change-Id: Ifc6562003a687577d7deb50260533a5147ae4f97
* Merge "New NativeDaemonConnector protocol adds a seqnum."Robert Greenwalt2012-03-061-2/+15
|\
| * New NativeDaemonConnector protocol adds a seqnum.Robert Greenwalt2012-03-051-2/+15
| | | | | | | | | | | | | | | | | | | | Allows for one socket to be multiplexed for multiple requests. Doesn't use command sequence numbers for broadcasts - would make no sense. Doesn't alter current default behavior so OEM's using these classes won't notice a difference. bug:5864209 Change-Id: Ie3b19c4f81eea868569229a365c8cb7de249c2dd
* | remove dependency on utils/List.hMathias Agopian2012-03-051-2/+2
|/ | | | Change-Id: I9a1e996be645520d1d5a056337303a6e5ed646e9
* Revert "New NativeDaemonConnector protocol adds a seqnum."Guang Zhu2012-02-071-10/+2
| | | | | | | | Reverting because it seems to break `adb reboot` This reverts commit dc58e73071aa829a5038caf37211f6b3e2d7b275. Change-Id: Ib8cc4379254694398cbb7f3e7a64c20e1ed8c1ba
* New NativeDaemonConnector protocol adds a seqnum.Robert Greenwalt2012-02-071-2/+10
| | | | | | | Allows for one socket to be multiplexed for multiple requests. bug:5864209 Change-Id: I934c88da25d95e093371f455442bdf2f0ed7a4f4
* Fix SocketListener socket leak issue.Xianzhu Wang2011-09-291-2/+3
| | | | | | | | | | | | The problem was: if a socket is shared between SocketListener and another thread, only if the last reference is removed by SocketListener can the socket be closed, otherwise the socket will leak. This sometimes happens in netd's dnsproxyd. This change let the SocketClient own the socket and close the socket when the SocketClient is destructed. Change-Id: I2865fbfe9ee4d8b3e43d7e02919dbb2d261f70de
* Fix potential race introduced in Icd7f5f03Brad Fitzpatrick2011-03-171-1/+1
| | | | | | | | | | | | Digit wrote: "You probably don't want to close the socket here without updating c->socket as well. Otherwise, another thread holding a handle to the client after the c->decRef() could end up sending a message to a different socket, if the file descriptor index is reused by another client in the meantime." Change-Id: Icdefb5ffc0c7607325d7db761e1f04e5d868bfb7
* SocketClient: add optional reference countingBrad Fitzpatrick2011-03-171-0/+11
| | | | | | | Needed to fix a race in netd. Bug: 3438459 Change-Id: Icd7f5f035510235f733a25c0621479d3e644b152
* Let SocketClient users write binary data to clients.Brad Fitzpatrick2010-10-271-0/+4
| | | | | | | | | | This is a dependency for the DNS proxy CLs. This CL also adds a new socket for the netd process to inherit which is owned by the inet group. (so only apps with the INTERNET permission can use the DNS proxy...) Change-Id: Ic3475c697913ba85805b4e49801b65e7a1d59289
* Fetch peer credentials for local socketsKenny Root2010-09-141-0/+13
| | | | | | | Fetch the PID, UID, and GID of the remote side of a local socket connection in case any users of this library class want to check it. Change-Id: Ia3230e6bc68ab6f93160df9f5996d2bf744b872c
* libsysutils: const correctness fixes + remove some debuggingSan Mehat2009-05-201-2/+2
| | | | Signed-off-by: San Mehat <san@google.com>
* libsysutils: Tweak SocketListener and friendsSan Mehat2009-05-121-1/+1
| | | | Signed-off-by: San Mehat <san@google.com>
* libsysutils: Add multiple client support and fix some bugsSan Mehat2009-05-101-0/+23