org.objectweb.dream.protocol.channel
Interface TCPIPProtocol

All Superinterfaces:
ChannelProtocol, Protocol
All Known Implementing Classes:
TCPIPProtocolImpl

public interface TCPIPProtocol
extends ChannelProtocol

Defines constants used as hints key that can be given to a TCP/IP protocol.


Field Summary
static String ADDRESS
          Key name for value used by the Protocol.createExportIdentifier(java.util.Map, org.objectweb.dream.protocol.ExportIdentifier[]) method to specify the address of the export identifier to create.
static String CONNECTION_RETRY
          This integer hint, used at bind time, can specify the number of connection retries before aborting.
static String PORT
          This integer hint, used at export time, can specify the listening port on which the TCP/IP protocol will wait incoming connection for an exported channel.
static String PORT_RANGE
          This integer hint, used at export time, can specify the range of listening ports on which the TCP/IP protocol will try to open server socket.
static String SO_LINGER
          This integer hint, used either at export or bind time, can specify the SO_LINGER parameter of created sockets.
static String SO_TIMEOUT
          This integer hint, used either at export or bind time, can specify the SO_TIMEOUT parameter of created sockets.
static String TCP_NO_DELAY
          This boolean hint, used either at export or bind time, can specify if the Nagle's algorithm is disabled.
 
Fields inherited from interface org.objectweb.dream.protocol.Protocol
ITF_NAME, LOWER_PROTOCOL_ITF_NAME
 
Method Summary
 OutgoingPush bind(String hostName, int port, IncomingPush toClientPush)
          Utility method.
 IPExportIdentifier createExportIdentifier(String hostName, int port)
          Utility method.
 IPExportIdentifier export(ChannelFactory channel, int port, int range)
          Utility method.
 
Methods inherited from interface org.objectweb.dream.protocol.channel.ChannelProtocol
bind, export, unexport
 
Methods inherited from interface org.objectweb.dream.protocol.Protocol
createExportIdentifier
 

Field Detail

PORT

static final String PORT
This integer hint, used at export time, can specify the listening port on which the TCP/IP protocol will wait incoming connection for an exported channel. Can also be used with the Protocol.createExportIdentifier(java.util.Map, org.objectweb.dream.protocol.ExportIdentifier[]) method to specify the port of the export identifier to create.

See Also:
Constant Field Values

PORT_RANGE

static final String PORT_RANGE
This integer hint, used at export time, can specify the range of listening ports on which the TCP/IP protocol will try to open server socket.
If this hints is not specified and a port has been specified (with PORT key), only the specified port will be tried before aborting.
if neither this hint nor the port hint are specified, the TCP/IP protocol will try any port starting from its current listening port.

See Also:
Constant Field Values

ADDRESS

static final String ADDRESS
Key name for value used by the Protocol.createExportIdentifier(java.util.Map, org.objectweb.dream.protocol.ExportIdentifier[]) method to specify the address of the export identifier to create. The value associated with this key can be an InetAddress or a String.

See Also:
Constant Field Values

CONNECTION_RETRY

static final String CONNECTION_RETRY
This integer hint, used at bind time, can specify the number of connection retries before aborting.

See Also:
Constant Field Values

TCP_NO_DELAY

static final String TCP_NO_DELAY
This boolean hint, used either at export or bind time, can specify if the Nagle's algorithm is disabled.

See Also:
Socket.setTcpNoDelay(boolean), Constant Field Values

SO_TIMEOUT

static final String SO_TIMEOUT
This integer hint, used either at export or bind time, can specify the SO_TIMEOUT parameter of created sockets.

See Also:
Socket.setSoTimeout(int), Constant Field Values

SO_LINGER

static final String SO_LINGER
This integer hint, used either at export or bind time, can specify the SO_LINGER parameter of created sockets. A negative value disable the linger on close.

See Also:
Socket.setSoLinger(boolean, int), Constant Field Values
Method Detail

export

IPExportIdentifier export(ChannelFactory channel,
                          int port,
                          int range)
                          throws ExportException
Utility method. Exports the channel through the given port.

Parameters:
channel - the channel to export
port - the listening port on which the TCP/IP protocol will wait incoming connection for an exported channel.
If null, the current listening port of the protocol is used.
range - the range of listening ports on which the TCP/IP protocol will try to open server socket.
If null, only one port will be tried before aborting. If negative, range is infinite.
Returns:
An export identifier.
Throws:
ExportException - if the export process fails.
See Also:
ChannelProtocol.export(ChannelFactory, java.util.Map)

bind

OutgoingPush bind(String hostName,
                  int port,
                  IncomingPush toClientPush)
                  throws InvalidExportIdentifierException,
                         BindException
Utility method.

Throws:
InvalidExportIdentifierException
BindException
See Also:
ChannelProtocol.bind(org.objectweb.dream.protocol.ExportIdentifier, IncomingPush, java.util.Map)

createExportIdentifier

IPExportIdentifier createExportIdentifier(String hostName,
                                          int port)
Utility method.

See Also:
Protocol.createExportIdentifier(java.util.Map, org.objectweb.dream.protocol.ExportIdentifier[])


Copyright © 2003, 2005 - INRIA Rhone-Alpes - All Rights Reserved.