|
|||||||||||
| 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(java.net.ServerSocket aServer)
Creates an unbound server socket. |
|
| Method Summary | |
|---|---|
java.net.Socket |
accept()
Listens for a connection to be made to this socket and accepts it. |
void |
bind(java.net.SocketAddress aEndpoint)
Binds the ServerSocketWrapper to a specific address (IP
address and port number). |
void |
bind(java.net.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. |
java.nio.channels.ServerSocketChannel |
getChannel()
Returns the unique ServerSocketChannel object
associated with this socket, if any. |
java.net.InetAddress |
getInetAddress()
Returns the local address of this server socket. |
int |
getLocalPort()
Returns the port on which this socket is listening. |
java.net.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. |
java.lang.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(java.net.ServerSocket aServer)
throws java.io.IOException
aServer - ServerSocket object
java.io.IOException - IO error when opening the socket.| Method Detail |
|---|
public void bind(java.net.SocketAddress aEndpoint)
throws java.io.IOException
ServerSocketWrapper to a specific address (IP
address and port number).
bind in class java.net.ServerSocketaEndpoint - The IP address & port number to bind to.
java.io.IOException - if the bind operation fails, or if the socket is already
bound.
public void bind(java.net.SocketAddress aEndpoint,
int aBacklog)
throws java.io.IOException
ServerSocketWrapper to a specific address (IP
address and port number) with specified backlog length.
bind in class java.net.ServerSocketaEndpoint - The IP address & port number to bind to.aBacklog - The listen backlog length.
java.io.IOException - if the bind operation fails, or if the socket is already
bound.public java.net.InetAddress getInetAddress()
getInetAddress in class java.net.ServerSocketnull
if the socket is unbound.public int getLocalPort()
getLocalPort in class java.net.ServerSocketpublic java.net.SocketAddress getLocalSocketAddress()
null if it is not bound yet.
getLocalSocketAddress in class java.net.ServerSocketSocketAddress representing the local endpoint of
this socket, or null if it is not bound yet.getInetAddress(),
getLocalPort()
public java.net.Socket accept()
throws java.io.IOException
accept in class java.net.ServerSocketjava.io.IOException - if an I/O error occurs when waiting for a connection.
public void close()
throws java.io.IOException
close in class java.net.ServerSocketjava.io.IOException - if an I/O error occurs when closing the socket.public java.nio.channels.ServerSocketChannel getChannel()
ServerSocketChannel object
associated with this socket, if any.
getChannel in class java.net.ServerSocketpublic boolean isBound()
isBound in class java.net.ServerSocketpublic boolean isClosed()
isClosed in class java.net.ServerSocket
public void setSoTimeout(int aTimeout)
throws java.net.SocketException
setSoTimeout in class java.net.ServerSocketaTimeout - the specified timeout, in milliseconds.
java.net.SocketException - if there is an error in the underlying protocol, such as a
TCP error.
public int getSoTimeout()
throws java.io.IOException
getSoTimeout in class java.net.ServerSocketjava.io.IOException - if an I/O error occurssetSoTimeout(int)
public void setReuseAddress(boolean aOn)
throws java.net.SocketException
setReuseAddress in class java.net.ServerSocketaOn - whether to enable or disable the socket option
java.net.SocketException - if an error occurs enabling or disabling the
SO_RESUEADDR socket option, or the socket is
closed.
public boolean getReuseAddress()
throws java.net.SocketException
getReuseAddress in class java.net.ServerSocketboolean indicating whether or not SO_REUSEADDR
is enabled.
java.net.SocketException - if there is an error in the underlying protocol, such as a
TCP error.setReuseAddress(boolean)public java.lang.String toString()
String.
toString in class java.net.ServerSocket
public void setReceiveBufferSize(int aSize)
throws java.net.SocketException
setReceiveBufferSize in class java.net.ServerSocketaSize - the size to which to set the receive buffer size. This value
must be greater than 0.
java.net.SocketException - if there is an error in the underlying protocol, such as a
TCP error.getReceiveBufferSize()
public int getReceiveBufferSize()
throws java.net.SocketException
getReceiveBufferSize in class java.net.ServerSocketjava.net.SocketException - 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 | ||||||||||