public abstract class AbstractIoConnector extends AbstractIoService implements IoConnector
IoConnector.AbstractIoService.ServiceOperationFuturedisposalLock, LOGGER, sessionConfig| Modifier | Constructor and Description |
|---|---|
protected |
AbstractIoConnector(IoSessionConfig sessionConfig,
Executor executor)
Constructor for
AbstractIoConnector. |
| Modifier and Type | Method and Description |
|---|---|
ConnectFuture |
connect()
Connects to the
default
remote address. |
ConnectFuture |
connect(IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
Connects to the
default
remote address and invokes the ioSessionInitializer when
the IoSession is created but before IoHandler.sessionCreated(IoSession)
is invoked. |
ConnectFuture |
connect(SocketAddress remoteAddress)
Connects to the specified remote address.
|
ConnectFuture |
connect(SocketAddress remoteAddress,
IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
Connects to the specified remote address and invokes
the
ioSessionInitializer when the IoSession is created but before
IoHandler.sessionCreated(IoSession) is invoked. |
ConnectFuture |
connect(SocketAddress remoteAddress,
SocketAddress localAddress)
Connects to the specified remote address binding to the specified local address.
|
ConnectFuture |
connect(SocketAddress remoteAddress,
SocketAddress localAddress,
IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
Connects to the specified remote address binding to the specified local
address and and invokes the
ioSessionInitializer when the
IoSession is created but before IoHandler.sessionCreated(IoSession)
is invoked. |
protected abstract ConnectFuture |
connect0(SocketAddress remoteAddress,
SocketAddress localAddress,
IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
Implement this method to perform the actual connect operation.
|
protected void |
finishSessionInitialization0(IoSession session,
IoFuture future)
Adds required internal attributes and
IoFutureListeners
related with event notifications to the specified session
and future. |
int |
getConnectTimeout()
Deprecated.
Take a look at
getConnectTimeoutMillis() |
long |
getConnectTimeoutCheckInterval() |
long |
getConnectTimeoutMillis() |
SocketAddress |
getDefaultLocalAddress() |
SocketAddress |
getDefaultRemoteAddress() |
void |
setConnectTimeout(int connectTimeout)
Deprecated.
Take a look at
setConnectTimeoutMillis(long) |
void |
setConnectTimeoutCheckInterval(long minimumConnectTimeout)
Sets the timeout for the connection check
|
void |
setConnectTimeoutMillis(long connectTimeoutInMillis)
Sets the connect timeout value in milliseconds.
|
void |
setDefaultLocalAddress(SocketAddress localAddress)
Sets the default local address
|
void |
setDefaultRemoteAddress(SocketAddress defaultRemoteAddress)
Sets the default remote address to connect to when no argument is
specified in
IoConnector.connect() method. |
String |
toString() |
addListener, broadcast, dispose, dispose, dispose0, executeWorker, executeWorker, getActivationTime, getFilterChain, getFilterChainBuilder, getHandler, getListeners, getManagedSessionCount, getManagedSessions, getScheduledWriteBytes, getScheduledWriteMessages, getSessionDataStructureFactory, getStatistics, initSession, isActive, isDisposed, isDisposing, removeListener, setFilterChainBuilder, setHandler, setSessionDataStructureFactoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddListener, broadcast, dispose, dispose, getActivationTime, getFilterChain, getFilterChainBuilder, getHandler, getManagedSessionCount, getManagedSessions, getScheduledWriteBytes, getScheduledWriteMessages, getSessionConfig, getSessionDataStructureFactory, getStatistics, getTransportMetadata, isActive, isDisposed, isDisposing, removeListener, setFilterChainBuilder, setHandler, setSessionDataStructureFactoryprotected AbstractIoConnector(IoSessionConfig sessionConfig, Executor executor)
AbstractIoConnector. You need to provide a
default session configuration and an Executor for handling I/O
events. If null Executor is provided, a default one will be
created using Executors.newCachedThreadPool().sessionConfig - the default configuration for the managed IoSessionexecutor - the Executor used for handling execution of I/O
events. Can be null.AbstractIoService(IoSessionConfig, Executor)public long getConnectTimeoutCheckInterval()
public void setConnectTimeoutCheckInterval(long minimumConnectTimeout)
minimumConnectTimeout - The delay we wait before checking the connection@Deprecated public final int getConnectTimeout()
getConnectTimeoutMillis()getConnectTimeout in interface IoConnectorpublic final long getConnectTimeoutMillis()
getConnectTimeoutMillis in interface IoConnector@Deprecated public final void setConnectTimeout(int connectTimeout)
setConnectTimeoutMillis(long)IoConnectorsetConnectTimeout in interface IoConnectorconnectTimeout - The time out for the connectionpublic final void setConnectTimeoutMillis(long connectTimeoutInMillis)
setConnectTimeoutMillis in interface IoConnectorconnectTimeoutInMillis - The time out for the connectionpublic SocketAddress getDefaultRemoteAddress()
getDefaultRemoteAddress in interface IoConnectorIoConnector.connect() method.public final void setDefaultLocalAddress(SocketAddress localAddress)
setDefaultLocalAddress in interface IoConnectorlocalAddress - The default local addresspublic final SocketAddress getDefaultLocalAddress()
getDefaultLocalAddress in interface IoConnectorpublic final void setDefaultRemoteAddress(SocketAddress defaultRemoteAddress)
IoConnector.connect() method.setDefaultRemoteAddress in interface IoConnectordefaultRemoteAddress - The default remote addresspublic final ConnectFuture connect()
default
remote address.connect in interface IoConnectorConnectFuture instance which is completed when the
connection attempt initiated by this call succeeds or fails.public ConnectFuture connect(IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
default
remote address and invokes the ioSessionInitializer when
the IoSession is created but before IoHandler.sessionCreated(IoSession)
is invoked. There is no guarantee that the ioSessionInitializer
will be invoked before this method returns.connect in interface IoConnectorsessionInitializer - the callback to invoke when the IoSession object is createdConnectFuture instance which is completed when the
connection attempt initiated by this call succeeds or fails.public final ConnectFuture connect(SocketAddress remoteAddress)
connect in interface IoConnectorremoteAddress - The remote address to connect toConnectFuture instance which is completed when the
connection attempt initiated by this call succeeds or fails.public ConnectFuture connect(SocketAddress remoteAddress, IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
ioSessionInitializer when the IoSession is created but before
IoHandler.sessionCreated(IoSession) is invoked. There is no
guarantee that the ioSessionInitializer will be invoked before
this method returns.connect in interface IoConnectorremoteAddress - the remote address to connect tosessionInitializer - the callback to invoke when the IoSession object is createdConnectFuture instance which is completed when the
connection attempt initiated by this call succeeds or fails.public ConnectFuture connect(SocketAddress remoteAddress, SocketAddress localAddress)
connect in interface IoConnectorremoteAddress - The remote address to connectlocalAddress - The local address to bindConnectFuture instance which is completed when the
connection attempt initiated by this call succeeds or fails.public final ConnectFuture connect(SocketAddress remoteAddress, SocketAddress localAddress, IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
ioSessionInitializer when the
IoSession is created but before IoHandler.sessionCreated(IoSession)
is invoked. There is no guarantee that the ioSessionInitializer
will be invoked before this method returns.connect in interface IoConnectorremoteAddress - the remote address to connect tolocalAddress - the local interface to bind tosessionInitializer - the callback to invoke when the IoSession object is createdConnectFuture instance which is completed when the
connection attempt initiated by this call succeeds or fails.protected abstract ConnectFuture connect0(SocketAddress remoteAddress, SocketAddress localAddress, IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
remoteAddress - The remote address to connect fromlocalAddress - null if no local address is specifiedsessionInitializer - The IoSessionInitializer to use when the connection s successfulprotected final void finishSessionInitialization0(IoSession session, IoFuture future)
IoFutureListeners
related with event notifications to the specified session
and future. Do not call this method directly;finishSessionInitialization0 in class AbstractIoServicesession - The session to initializefuture - The Future to useCopyright © 2004–2024 Apache MINA Project. All rights reserved.