org.mpisws.p2p.transport.wire
Class TCPLayer
java.lang.Object
rice.selector.SelectionKeyHandler
org.mpisws.p2p.transport.wire.TCPLayer
public class TCPLayer
- extends SelectionKeyHandler
Method Summary |
void |
accept(java.nio.channels.SelectionKey key)
Specified by the SelectionKeyHandler interface. |
void |
acceptSockets(boolean b)
|
void |
destroy()
Method which cloeses a socket to a given remote node handle, and updates
the bookkeeping to keep track of this closing. |
boolean |
isDestroyed()
|
SocketRequestHandle<java.net.InetSocketAddress> |
openSocket(java.net.InetSocketAddress destination,
SocketCallback<java.net.InetSocketAddress> deliverSocketToMe,
java.util.Map<java.lang.String,java.lang.Object> options)
|
protected void |
socketClosed(SocketManager sm)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OPTIONS
public static final java.util.Map<java.lang.String,java.lang.Object> OPTIONS
MAX_OPEN_SOCKETS
public final int MAX_OPEN_SOCKETS
SOCKET_BUFFER_SIZE
public final int SOCKET_BUFFER_SIZE
TCP_NO_DELAY
public boolean TCP_NO_DELAY
TCPLayer
public TCPLayer(WireTransportLayerImpl wire,
boolean enableServer)
throws java.io.IOException
- Which socket to collect.
- Throws:
java.io.IOException
openSocket
public SocketRequestHandle<java.net.InetSocketAddress> openSocket(java.net.InetSocketAddress destination,
SocketCallback<java.net.InetSocketAddress> deliverSocketToMe,
java.util.Map<java.lang.String,java.lang.Object> options)
socketClosed
protected void socketClosed(SocketManager sm)
destroy
public void destroy()
- Method which cloeses a socket to a given remote node handle, and updates
the bookkeeping to keep track of this closing. Note that this method does
not completely close the socket, rather, it simply calls shutdown(), which
starts the shutdown process.
- Parameters:
address
- The address of the remote node
acceptSockets
public void acceptSockets(boolean b)
accept
public void accept(java.nio.channels.SelectionKey key)
- Specified by the SelectionKeyHandler interface. Is called whenever a key
has become acceptable, representing an incoming connection. This method
will accept the connection, and attach a SocketConnector in order to read
the greeting off of the channel. Once the greeting has been read, the
connector will hand the channel off to the appropriate node handle.
- Overrides:
accept
in class SelectionKeyHandler
- Parameters:
key
- The key which is acceptable.
isDestroyed
public boolean isDestroyed()
Copyright © 2001-2005 - Rice Pastry.