|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.net.LocalSocketImpl
class LocalSocketImpl
Socket implementation used for android.net.LocalSocket and android.net.LocalServerSocket. Supports only AF_LOCAL sockets.
| Nested Class Summary | |
|---|---|
(package private) class |
LocalSocketImpl.SocketInputStream
An input stream for local sockets. |
(package private) class |
LocalSocketImpl.SocketOutputStream
An output stream for local sockets. |
| Field Summary | |
|---|---|
(package private) FileDescriptor[] |
inboundFileDescriptors
file descriptor array received during a previous read |
(package private) FileDescriptor[] |
outboundFileDescriptors
file descriptor array that should be written during next write |
| Constructor Summary | |
|---|---|
LocalSocketImpl()
Create a new instance. |
|
LocalSocketImpl(FileDescriptor fd)
Create a new instance from a file descriptor representing a bound socket. |
|
| Method Summary | |
|---|---|
protected void |
accept(LocalSocketImpl s)
Accepts a new connection to the socket. |
protected int |
available()
Returns the number of bytes available for reading without blocking. |
void |
bind(LocalSocketAddress endpoint)
Binds this socket to an endpoint name. |
void |
close()
Closes the socket. |
protected void |
connect(LocalSocketAddress address,
int timeout)
note timeout presently ignored |
void |
create(boolean stream)
Creates a socket in the underlying OS. |
protected void |
finalize()
Called by the virtual machine when there are no longer any (non-weak) references to the receiver. |
FileDescriptor[] |
getAncillaryFileDescriptors()
Retrieves a set of file descriptors that a peer has sent through an ancillary message. |
protected FileDescriptor |
getFileDescriptor()
|
protected InputStream |
getInputStream()
Retrieves the input stream for this instance. |
Object |
getOption(int optID)
|
protected OutputStream |
getOutputStream()
Retrieves the output stream for this instance. |
Credentials |
getPeerCredentials()
Retrieves the credentials of this socket's peer. |
LocalSocketAddress |
getSockAddress()
Retrieves the socket name from the OS. |
protected void |
listen(int backlog)
|
protected void |
sendUrgentData(int data)
|
void |
setFileDescriptorsForSend(FileDescriptor[] fds)
Enqueues a set of file descriptors to send to the peer. |
void |
setOption(int optID,
Object value)
|
protected void |
shutdownInput()
Shuts down the input side of the socket. |
protected void |
shutdownOutput()
Shuts down the output side of the socket. |
protected boolean |
supportsUrgentData()
|
String |
toString()
Returns a string containing a concise, human-readable description of the receiver. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
FileDescriptor[] inboundFileDescriptors
FileDescriptor[] outboundFileDescriptors
| Constructor Detail |
|---|
LocalSocketImpl()
LocalSocketImpl(FileDescriptor fd)
throws IOException
fd - non-null; bound file descriptor
IOException| Method Detail |
|---|
public String toString()
Object
toString in class Object
public void create(boolean stream)
throws IOException
stream - true if this should be a stream socket, false for
datagram.
IOException
public void close()
throws IOException
IOException
protected void connect(LocalSocketAddress address,
int timeout)
throws IOException
IOException
public void bind(LocalSocketAddress endpoint)
throws IOException
endpoint - endpoint address
IOException
protected void listen(int backlog)
throws IOException
IOException
protected void accept(LocalSocketImpl s)
throws IOException
s - a socket that will be used to represent the new connection.
IOException
protected InputStream getInputStream()
throws IOException
IOException - if socket has been closed or cannot be created.
protected OutputStream getOutputStream()
throws IOException
IOException - if socket has been closed or cannot be created.
protected int available()
throws IOException
IOException
protected void shutdownInput()
throws IOException
IOException
protected void shutdownOutput()
throws IOException
IOExceptionprotected FileDescriptor getFileDescriptor()
protected boolean supportsUrgentData()
protected void sendUrgentData(int data)
throws IOException
IOException
public Object getOption(int optID)
throws IOException
IOException
public void setOption(int optID,
Object value)
throws IOException
IOExceptionpublic void setFileDescriptorsForSend(FileDescriptor[] fds)
fds - non-null; file descriptors to send.
IOException
public FileDescriptor[] getAncillaryFileDescriptors()
throws IOException
IOException
public Credentials getPeerCredentials()
throws IOException
IOException
public LocalSocketAddress getSockAddress()
throws IOException
IOException - on failure
protected void finalize()
throws IOException
ObjectNote: The virtual machine assumes that the implementation in class Object is empty.
finalize in class ObjectIOException
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||