|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.net.SocketImpl
This is the Socket implementation class. It is an abstract class that must be subclassed to provide an actual implementation.
Field Summary | |
protected InetAddress |
address
The internet address where the socket will make a connection. |
protected FileDescriptor |
fd
The file descriptor object |
protected int |
localport
|
protected int |
port
The port where the socket will make a connection. |
Constructor Summary | |
SocketImpl()
|
Method Summary | |
protected abstract void |
accept(SocketImpl s)
Accepts a connection. |
protected abstract int |
available()
Returns the number of bytes that can be read without blocking. |
protected abstract void |
bind(InetAddress host,
int port)
Binds the socket to the specified port on the specified host. |
protected abstract void |
close()
Closes the socket. |
protected abstract void |
connect(InetAddress address,
int port)
Connects the socket to the specified address on the specified port. |
protected abstract void |
connect(String host,
int port)
Connects the socket to the specified port on the specified host. |
protected abstract void |
create(boolean stream)
Creates a socket with a boolean that specifies whether this is a stream socket or a datagram socket. |
protected FileDescriptor |
getFileDescriptor()
|
protected InetAddress |
getInetAddress()
|
protected abstract InputStream |
getInputStream()
Gets an InputStream for this socket. |
protected int |
getLocalPort()
|
protected abstract OutputStream |
getOutputStream()
Gets an OutputStream for this socket. |
protected int |
getPort()
|
protected abstract void |
listen(int backlog)
Specify to the system how many connection requests the system will queue up while waiting for the SocketImpl to execute accept(). |
String |
toString()
Returns the address and port of this Socket as a String. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected FileDescriptor fd
protected InetAddress address
protected int port
protected int localport
Constructor Detail |
public SocketImpl()
Method Detail |
protected abstract void create(boolean stream) throws IOException
stream
- a boolean indicating whether this is a stream
or datagram socket
IOException
protected abstract void connect(String host, int port) throws IOException
host
- the specified host of the connectionport
- the port where the connection is made
IOException
protected abstract void connect(InetAddress address, int port) throws IOException
address
- the specified address of the connectionport
- the specified port where connection is made
IOException
protected abstract void bind(InetAddress host, int port) throws IOException
host
- the hostport
- the port
IOException
protected abstract void listen(int backlog) throws IOException
backlog
- the number of queued connect requests pending accept
IOException
protected abstract void accept(SocketImpl s) throws IOException
s
- the accepted connection
IOException
protected abstract InputStream getInputStream() throws IOException
IOException
protected abstract OutputStream getOutputStream() throws IOException
IOException
protected abstract int available() throws IOException
IOException
protected abstract void close() throws IOException
IOException
protected FileDescriptor getFileDescriptor()
protected InetAddress getInetAddress()
protected int getPort()
protected int getLocalPort()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |