summaryrefslogtreecommitdiff
path: root/core/java/android/net/LocalServerSocket.java
Commit message (Collapse)AuthorAgeFilesLines
* Add a module-lib API for constructing a LocalSocket from an fd.Lorenzo Colitti2022-01-251-1/+3
| | | | | | | | | | | | | | | | This allows constructing a LocalSocket from a FileDescriptor referring to an already-connected socket. The LocalSocket can then be used to exchange ancillary filedescriptors and fetch peer socket credentials for the existing FD. The fd is not dup'd or closed by the API, and the caller is responsible for closing it. This is consistent with the constructor of the related LocalServerSocket class, which also takes an fd and does not manage its lifecycle. Bug: 200200870 Test: atest CoreTests:android.net.LocalSocketTest CtsNetTestCases:android.net.cts.LocalSocketTest Change-Id: I86448ba80475c4563194a4a2d9a0c0bbd0b76444
* Implement Closeable on LocalServerSocket.Jake Wharton2017-09-201-3/+4
| | | | | | Bug: 37013067 Test: existing ones still pass Change-Id: I78402ebb19a592fc3960eb6200cb5ad436a7b344
* Refactor RFCOMM / BluetoothSocket usage of LocalSocketNeil Fuller2017-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | LocalSocket is used by BluetoothSocket. BluetoothSocket passes a pre-created file descriptor to LocalSocket that is then given to the LocalSocketImpl. Commit b08c7bc0bdc48ae95be2697ca27ea89a9dd92c3e broke the behavior. Commit 7a8c36aa4e6a1b5e48f0ee5a787f10bcfece7587 put in a minimal fix. This change tidies up LocalSocket and associated classes and replaces a specialist constructor with a factory method to highlight the special case. While there an unnecessary exception has been removed. Bug: 34111534 Test: Boot device Test: vogar --mode app_process tests/tests/net/src/android/net/cts/LocalSocketTest.java Change-Id: I4ba2f2d9ea361a950ff8bc8d64fc800d998c3210
* Set isConnected, isBound, implCreated on server-side LocalSocketsNeil Fuller2017-01-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously LocalServerSocket.accept() would return a LocalSocket instance with isConnected, isBound and implCreated set to false. [implCreated determines whether impl.create() needs to called]. A socket created via accept() in this way is implicitly bound and connected. impl.create() does not need to be called because impl.accept(LocalSocketImpl s) is called instead and has the same effect (s.fd and s.mFdCreatedInternally set correctly). This change modifies the behavior so that the flags are now all set to true in this case and isBound() and isConnected() will now return the correct answer. Attempts to call bind() and connect() will still throw IOException as before, but with a different exception message. Correctly setting implCreated in LocalSocket means that LocalSocketImpl.create() will no longer be called for accept() created sockets and no longer needs to treat the "fd != null" case as a no-op: we can now assert that there must be no fd set when create() is called as we will no longer call it with sockets created using accept(). Bug: https://code.google.com/p/android/issues/detail?id=35942 Test: Device boot Test: vogar --mode app_process cts/tests/tests/net/src/android/net/cts/LocalServerSocketTest.java Test: vogar --mode app_process cts/tests/tests/net/src/android/net/cts/LocalSocketTest.java Change-Id: I3ac55439412e84501ae7c5ae6c9976e03b2d6fc5
* Fix typo.Elliott Hughes2014-12-081-7/+3
| | | | | Bug: https://code.google.com/p/android/issues/detail?id=78422 Change-Id: I0dfbb74334e126062660831a4e01817dde068b56
* LocalSocket: Add support for SOCK_DGRAM and SOCK_SEQPACKETMike Lockwood2013-07-161-2/+2
| | | | | | Also replaced some JNI code with libcore IO support Change-Id: I091e2b6b8dd1fec554936c1ffab29e50f0979e4a
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+117
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-117/+0
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+117