|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.net.ServerSocket
com.ibm.di.api.remote.impl.rmi.ServerSocketWrapper
public class ServerSocketWrapper
A wrapper class of ServerSocket class for use by the RMI. ServerSocket class implements server sockets. A server socket waits for requests to come in over the network. It performs some operation based on that request, and then possibly returns a result to the requester.
| Constructor Summary | |
|---|---|
ServerSocketWrapper(ServerSocket aServer)
Creates an unbound server socket. |
|
| Method Summary | |
|---|---|
Socket |
accept()
Listens for a connection to be made to this socket and accepts it. |
void |
bind(SocketAddress aEndpoint)
Binds the ServerSocketWrapper to a specific address (IP
address and port number). |
void |
bind(SocketAddress aEndpoint,
int aBacklog)
Binds the ServerSocketWrapper to a specific address (IP
address and port number) with specified backlog length. |
void |
close()
Closes this socket. |
ServerSocketChannel |
getChannel()
Returns the unique ServerSocketChannel object
associated with this socket, if any. |
InetAddress |
getInetAddress()
Returns the local address of this server socket. |
int |
getLocalPort()
Returns the port on which this socket is listening. |
SocketAddress |
getLocalSocketAddress()
Returns the address of the endpoint this socket is bound to, or null if it is not bound yet. |
int |
getReceiveBufferSize()
Gets the value of the SO_RCVBUF option for this ServerSocketWrapper, that is the proposed buffer size that will be used for Sockets accepted from this ServerSocketWrapper. |
boolean |
getReuseAddress()
Tests if SO_REUSEADDR is enabled. |
int |
getSoTimeout()
Retrive setting for SO_TIMEOUT. |
boolean |
isBound()
Returns the binding state of the ServerSocket. |
boolean |
isClosed()
Returns the closed state of the ServerSocketWrapper. |
void |
setReceiveBufferSize(int aSize)
Sets a default proposed value for the SO_RCVBUF option for sockets accepted from this ServerSocketWrapper. |
void |
setReuseAddress(boolean aOn)
Enable/disable the SO_REUSEADDR socket option. |
void |
setSoTimeout(int aTimeout)
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. |
String |
toString()
Returns the implementation address and implementation port of this socket as a String. |
| Methods inherited from class java.net.ServerSocket |
|---|
implAccept, setPerformancePreferences, setSocketFactory |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ServerSocketWrapper(ServerSocket aServer)
throws IOException
aServer - ServerSocket object
IOException - IO error when opening the socket.| Method Detail |
|---|
public void bind(SocketAddress aEndpoint)
throws IOException
ServerSocketWrapper to a specific address (IP
address and port number).
bind in class ServerSocketaEndpoint - The IP address & port number to bind to.
IOException - if the bind operation fails, or if the socket is already
bound.
public void bind(SocketAddress aEndpoint,
int aBacklog)
throws IOException
ServerSocketWrapper to a specific address (IP
address and port number) with specified backlog length.
bind in class ServerSocketaEndpoint - The IP address & port number to bind to.aBacklog - The listen backlog length.
IOException - if the bind operation fails, or if the socket is already
bound.public InetAddress getInetAddress()
getInetAddress in class ServerSocketnull
if the socket is unbound.public int getLocalPort()
getLocalPort in class ServerSocketpublic SocketAddress getLocalSocketAddress()
null if it is not bound yet.
getLocalSocketAddress in class ServerSocketSocketAddress representing the local endpoint of
this socket, or null if it is not bound yet.getInetAddress(),
getLocalPort()
public Socket accept()
throws IOException
accept in class ServerSocketIOException - if an I/O error occurs when waiting for a connection.
public void close()
throws IOException
close in class ServerSocketIOException - if an I/O error occurs when closing the socket.public ServerSocketChannel getChannel()
ServerSocketChannel object
associated with this socket, if any.
getChannel in class ServerSocketpublic boolean isBound()
isBound in class ServerSocketpublic boolean isClosed()
isClosed in class ServerSocket
public void setSoTimeout(int aTimeout)
throws SocketException
setSoTimeout in class ServerSocketaTimeout - the specified timeout, in milliseconds.
SocketException - if there is an error in the underlying protocol, such as a
TCP error.
public int getSoTimeout()
throws IOException
getSoTimeout in class ServerSocketIOException - if an I/O error occurssetSoTimeout(int)
public void setReuseAddress(boolean aOn)
throws SocketException
setReuseAddress in class ServerSocketaOn - whether to enable or disable the socket option
SocketException - if an error occurs enabling or disabling the
SO_RESUEADDR socket option, or the socket is
closed.
public boolean getReuseAddress()
throws SocketException
getReuseAddress in class ServerSocketboolean indicating whether or not SO_REUSEADDR
is enabled.
SocketException - if there is an error in the underlying protocol, such as a
TCP error.setReuseAddress(boolean)public String toString()
String.
toString in class ServerSocket
public void setReceiveBufferSize(int aSize)
throws SocketException
setReceiveBufferSize in class ServerSocketaSize - the size to which to set the receive buffer size. This value
must be greater than 0.
SocketException - if there is an error in the underlying protocol, such as a
TCP error.getReceiveBufferSize()
public int getReceiveBufferSize()
throws SocketException
getReceiveBufferSize in class ServerSocketSocketException - if there is an error in the underlying protocol, such as a
TCP error.setReceiveBufferSize(int)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||