|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.dream.AbstractComponent
org.objectweb.dream.channel.IPSocketManagerTCPImpl
IPSocketManager
that handles one TCP connection at a time. A new
connection is established for each
IPSocketManager.getSocket(InetAddress, int)
method call, and
connections are closed by
IPSocketManager.releaseSocket(SocketState, boolean)
method.
Field Summary | |
protected int |
cnxRetry
|
static String |
SOCKET_STATE_POOL_ITF_NAME
The name of the client interface used to pool socket state instances |
protected ObjectPool |
socketStatePoolItf
|
protected int |
soLinger
|
protected int |
soTimeout
|
protected boolean |
tcpNoDelay
|
Fields inherited from class org.objectweb.dream.AbstractComponent |
bindingLogger, componentDesc, fcState, firstStart, lifeCycleLogger, logger, weaveableC |
Fields inherited from interface org.objectweb.dream.channel.IPSocketManager |
ITF_NAME |
Fields inherited from interface org.objectweb.dream.channel.IPSocketManagerTCPAttributeController |
CNX_RETRY_DEFAULT |
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController |
STARTED, STOPPED |
Constructor Summary | |
IPSocketManagerTCPImpl()
|
Method Summary | |
void |
bindFc(String clientItfName,
Object serverItf)
|
int |
getCnxRetry()
Returns the number of connection retry before abording. |
SocketState |
getSocket(InetAddress address,
int port)
Returns a socket that can be used to send message to the ChannelIn identified by the given IP address and port. |
int |
getSoLinger()
Returns the SO_LINGER parameter setted on created sockets. |
int |
getSoTimeout()
Returns the SO_TIMEOUT parameter setted on created sockets. |
boolean |
getTcpNoDelay()
Returns true if the Nagle's algorithm is disabled on created
sockets. |
String[] |
listFc()
|
void |
releaseSocket(SocketState socketState,
boolean error)
Releases the given SocketStateImpl . |
void |
setCnxRetry(int cnxRetry)
Sets the cnxRetry attribute's value. |
protected void |
setSocketOption(Socket sock)
|
void |
setSoLinger(int timeout)
Sets the soLinger attribute's value. |
void |
setSoTimeout(int timeout)
Sets the soTimeout attribute's value. |
void |
setTcpNoDelay(boolean tcpNoDelay)
Sets the tcpNoDelay attribute's value. |
Methods inherited from class org.objectweb.dream.AbstractComponent |
beforeFirstStart, getFcState, initComponent, lookupFc, setLogger, startFc, stopFc, unbindFc |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int cnxRetry
protected boolean tcpNoDelay
protected int soTimeout
protected int soLinger
public static final String SOCKET_STATE_POOL_ITF_NAME
protected ObjectPool socketStatePoolItf
Constructor Detail |
public IPSocketManagerTCPImpl()
Method Detail |
public SocketState getSocket(InetAddress address, int port) throws IOException
IPSocketManager
getSocket
in interface IPSocketManager
address
- the address of the ChannelIn.port
- the port of the ChannelIn.
IOException
- if the socket can't be opened.IPSocketManager.getSocket(InetAddress, int)
public void releaseSocket(SocketState socketState, boolean error)
IPSocketManager
SocketStateImpl
.
releaseSocket
in interface IPSocketManager
socketState
- the socket state to release.error
- true
if an exception has been catched while
sending the message, false
otherwise.IPSocketManager.releaseSocket(SocketState, boolean)
protected void setSocketOption(Socket sock) throws SocketException
SocketException
public int getCnxRetry()
IPSocketManagerTCPAttributeController
getCnxRetry
in interface IPSocketManagerTCPAttributeController
IPSocketManagerTCPAttributeController.CNX_RETRY_DEFAULT
by default, or the value setted by
IPSocketManagerTCPAttributeController.setCnxRetry(int)
.IPSocketManagerTCPAttributeController.getCnxRetry()
public void setCnxRetry(int cnxRetry)
IPSocketManagerTCPAttributeController
cnxRetry
attribute's value.
setCnxRetry
in interface IPSocketManagerTCPAttributeController
cnxRetry
- the number of connection retry before abording.IPSocketManagerTCPAttributeController.setCnxRetry(int)
public boolean getTcpNoDelay()
IPSocketManagerTCPAttributeController
true
if the Nagle's algorithm is disabled on created
sockets.
getTcpNoDelay
in interface IPSocketManagerTCPAttributeController
tcpNoDelay
attribute's value.IPSocketManagerTCPAttributeController.getTcpNoDelay()
public void setTcpNoDelay(boolean tcpNoDelay)
IPSocketManagerTCPAttributeController
tcpNoDelay
attribute's value.
setTcpNoDelay
in interface IPSocketManagerTCPAttributeController
tcpNoDelay
- the new tcpNoDelay
attribute's value.IPSocketManagerTCPAttributeController.setTcpNoDelay(boolean)
public int getSoTimeout()
IPSocketManagerTCPAttributeController
SO_TIMEOUT
parameter setted on created sockets.
getSoTimeout
in interface IPSocketManagerTCPAttributeController
soTimeout
attribute's value.IPSocketManagerTCPAttributeController.getSoTimeout()
public void setSoTimeout(int timeout)
IPSocketManagerTCPAttributeController
soTimeout
attribute's value.
setSoTimeout
in interface IPSocketManagerTCPAttributeController
timeout
- the new soTimeout
attribute's value.IPSocketManagerTCPAttributeController.setSoTimeout(int)
public int getSoLinger()
IPSocketManagerTCPAttributeController
SO_LINGER
parameter setted on created sockets. A
negative value disable the linger on close.
getSoLinger
in interface IPSocketManagerTCPAttributeController
soLinger
attribute's value.IPSocketManagerTCPAttributeController.getSoLinger()
public void setSoLinger(int timeout)
IPSocketManagerTCPAttributeController
soLinger
attribute's value.
setSoLinger
in interface IPSocketManagerTCPAttributeController
timeout
- the new soLinger
attribute's value.IPSocketManagerTCPAttributeController.setSoLinger(int)
public String[] listFc()
listFc
in interface BindingController
BindingController.listFc()
public void bindFc(String clientItfName, Object serverItf) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException
bindFc
in interface BindingController
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
BindingController.bindFc(String,
Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |