Hi all,
SocketConnector closes Session at 20 sec. when idle. But i have set the
worker timeout to 100 sec.
Despite
// worker timeout to 100 second to make the I/O thread quit soon
connector.setWorkerTimeout( 100 );
and
// HTTP_CONNECT_TIMEOUT = 10 sec.
cfg.setConnectTimeout( SmsCenterConstants.HTTP_CONNECT_TIMEOUT );
I couldn't find why? Would you pls. help me?
SocketConnector connector = new SocketConnector();
// Change the worker timeout to 1000 second to make the I/O
thread quit soon
// when there's no connection to manage.
connector.setWorkerTimeout( 1000 );
// Configure the service.
SocketConnectorConfig cfg = new SocketConnectorConfig();
cfg.setThreadModel(
ExecutorThreadModel.getInstance("SmsCenterConnector"));
cfg.setConnectTimeout( SmsCenterConstants.HTTP_CONNECT_TIMEOUT
);
cfg.getFilterChain().addLast(
"codec",
new ProtocolCodecFilter( new
SmscHttpClientProtocolCodecFactory( ) ) );
cfg.getFilterChain().addLast( "logger", new LoggingFilter() );
try
{
ConnectFuture future = connector.connect(
new InetSocketAddress( SmsCenterConstants.smscUrl,
SmsCenterConstants.smscPort ),
new SmsCenterCommHandlerTCELL(), cfg );
future.join();
smscSession = future.getSession();
}
catch( RuntimeIOException e )
{
System.err.println( "Failed to connect to SMSC Gateway." );
e.printStackTrace();
}
---------------
Murat OZDEMiR
Software Designer