DthingApi
|
Public Member Functions | |
String | toString () |
![]() | |
Object | getOption (int optID) throws SocketException |
void | setOption (int optID, int val) throws SocketException |
Protected Member Functions | |
abstract int | available () throws IOException |
abstract void | bind (InetAddress address, int port) throws IOException |
abstract void | close () throws IOException |
abstract void | connect (String host, int port) throws IOException |
abstract void | connect (InetAddress address, int port) throws IOException |
abstract void | create () throws IOException |
InetAddress | getInetAddress () |
abstract InputStream | getInputStream () throws IOException |
int | getLocalPort () |
abstract OutputStream | getOutputStream () throws IOException |
int | getPort () |
void | shutdownInput () throws IOException |
void | shutdownOutput () throws IOException |
abstract void | connect (SocketAddress remoteAddr, int timeout) throws IOException |
void | setPerformancePreferences (int connectionTime, int latency, int bandwidth) |
Protected Attributes | |
InetAddress | address |
int | port |
int | localport |
Additional Inherited Members | |
![]() | |
static final int | SO_LINGER = 128 |
static final int | SO_TIMEOUT = 4102 |
static final int | TCP_NODELAY = 1 |
static final int | IP_MULTICAST_IF = 16 |
static final int | SO_BINDADDR = 15 |
static final int | SO_REUSEADDR = 4 |
static final int | SO_SNDBUF = 4097 |
static final int | SO_RCVBUF = 4098 |
static final int | SO_KEEPALIVE = 8 |
static final int | IP_TOS = 3 |
static final int | IP_MULTICAST_LOOP = 18 |
static final int | SO_BROADCAST = 32 |
static final int | SO_OOBINLINE = 4099 |
static final int | IP_MULTICAST_IF2 = 31 |
This class is the base of all streaming socket implementation classes. Streaming sockets are wrapped by two classes,
and
at the server and client end of a connection. At the server, there are two types of sockets engaged in communication, the
on a well known port (referred to as listener) used to establish a connection and the resulting
(referred to as host).
|
abstractprotected |
Returns the available number of bytes which are readable from this socket without blocking.
IOException | if an error occurs while reading the number of bytes. |
|
abstractprotected |
Binds this socket to the specified local host address and port number.
address | the local machine address to bind this socket to. |
port | the port on the local machine to bind this socket to. |
IOException | if an error occurs while binding this socket. |
|
abstractprotected |
Closes this socket. This makes later access invalid.
IOException | if an error occurs while closing this socket. |
|
abstractprotected |
Connects this socket to the specified remote host and port number.
host | the remote host this socket has to be connected to. |
port | the remote port on which this socket has to be connected. |
IOException | if an error occurs while connecting to the remote host. |
|
abstractprotected |
Connects this socket to the specified remote host address and port number.
address | the remote host address this socket has to be connected to. |
port | the remote port on which this socket has to be connected. |
IOException | if an error occurs while connecting to the remote host. |
|
abstractprotected |
Connects this socket to the remote host address and port number specified by the
object with the given timeout. This method will block indefinitely if the timeout is set to zero.
remoteAddr | the remote host address and port number to connect to. |
timeout | the timeout value in milliseconds. |
IOException | if an error occurs while connecting. |
|
abstractprotected |
Creates a new unconnected socket. The argument
defines whether the new socket is a streaming or a datagram socket.
isStreaming | defines whether the type of the new socket is streaming or datagram. |
IOException | if an error occurs while creating the socket. |
|
inlineprotected |
Gets the remote address this socket is connected to.
|
abstractprotected |
Gets the input stream of this socket.
IOException | if an error occurs while accessing the input stream. |
|
inlineprotected |
Gets the local port number of this socket. The field is initialized to
and upon demand will go to the IP stack to get the bound value. See the class comment for the context of the local port.
|
abstractprotected |
Gets the output stream of this socket.
IOException | if an error occurs while accessing the output stream. |
|
inlineprotected |
Gets the remote port number of this socket. This value is not meaningful when this instance is wrapped by a
.
|
inlineprotected |
Sets performance preference for connection time, latency and bandwidth. Does nothing by default.
connectionTime | the importance of connect time. |
latency | the importance of latency. |
bandwidth | the importance of bandwidth. |
|
inlineprotected |
Closes the input channel of this socket.
This default implementation always throws an IOException to indicate that the subclass should have overridden this method.
IOException | always because this method should be overridden. |
|
inlineprotected |
Closes the output channel of this socket.
This default implementation always throws an IOException to indicate that the subclass should have overridden this method.
IOException | always because this method should be overridden. |
|
inline |
Returns a string containing a concise, human-readable description of the socket.
|
protected |
The remote address this socket is connected to.
|
protected |
The local port this socket is connected to.
|
protected |
The remote port this socket is connected to.