java.lang.Object | |
↳ | android.net.LocalSocket |
Creates a (non-server) socket in the UNIX-domain namespace. The interface here is not entirely unlike that of java.net.Socket
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | SOCKET_DGRAM | Datagram socket type | |||||||||
int | SOCKET_SEQPACKET | Sequential packet socket type | |||||||||
int | SOCKET_STREAM | Stream socket type |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Creates a AF_LOCAL/UNIX domain stream socket.
|
||||||||||
|
Creates a AF_LOCAL/UNIX domain stream socket with given socket type
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Binds this socket to an endpoint name.
|
||||||||||
|
Closes the socket.
|
||||||||||
|
|
||||||||||
|
Connects this socket to an endpoint.
|
||||||||||
|
Retrieves a set of file descriptors that a peer has sent through
an ancillary message.
|
||||||||||
|
Returns file descriptor or null if not yet open/already closed
|
||||||||||
|
Retrieves the input stream for this instance.
|
||||||||||
|
Retrieves the name that this socket is bound to, if any.
|
||||||||||
|
Retrieves the output stream for this instance.
|
||||||||||
|
Retrieves the credentials of this socket's peer.
|
||||||||||
|
|
||||||||||
|
|
||||||||||
|
|
||||||||||
|
|
||||||||||
|
|
||||||||||
|
|
||||||||||
|
|
||||||||||
|
|
||||||||||
|
|
||||||||||
|
Enqueues a set of file descriptors to send to the peer.
|
||||||||||
|
|
||||||||||
|
|
||||||||||
|
|
||||||||||
|
Shuts down the input side of the socket.
|
||||||||||
|
Shuts down the output side of the socket.
|
||||||||||
|
Returns a string containing a concise, human-readable description of this
object.
|
[Expand]
Inherited Methods
|
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
|||||||||||
From interface
java.io.Closeable
|
|||||||||||
From interface
java.lang.AutoCloseable
|
Datagram socket type
Sequential packet socket type
Stream socket type
Creates a AF_LOCAL/UNIX domain stream socket with given socket type
sockType |
either
SOCKET_DGRAM
,
SOCKET_STREAM
or
SOCKET_SEQPACKET
|
---|
Binds this socket to an endpoint name. May only be called on an instance that has not yet been bound.
bindpoint | endpoint address |
---|
IOException |
---|
IOException |
---|
Connects this socket to an endpoint. May only be called on an instance that has not yet been connected.
endpoint | endpoint address |
---|
IOException | if socket is in invalid state or the address does not exist. |
---|
Retrieves a set of file descriptors that a peer has sent through an ancillary message. This method retrieves the most recent set sent, and then returns null until a new set arrives. File descriptors may only be passed along with regular data, so this method can only return a non-null after a read operation.
IOException |
---|
Returns file descriptor or null if not yet open/already closed
Retrieves the input stream for this instance.
IOException | if socket has been closed or cannot be created. |
---|
Retrieves the name that this socket is bound to, if any.
Retrieves the output stream for this instance.
IOException | if socket has been closed or cannot be created. |
---|
Retrieves the credentials of this socket's peer. Only valid on connected sockets.
IOException |
---|
Enqueues a set of file descriptors to send to the peer. The queue is one deep. The file descriptors will be sent with the next write of normal data, and will be delivered in a single ancillary message. See "man 7 unix" SCM_RIGHTS on a desktop Linux machine.
fds | non-null; file descriptors to send. |
---|
Shuts down the input side of the socket.
IOException |
---|
Shuts down the output side of the socket.
IOException |
---|
Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
See
Writing a useful
toString
method
if you intend implementing your own
toString
method.