// and start both.
ioThreadPoolFilter.start();
protocolThreadPoolFilter.start();
IoProtocolConnector connector = new IoProtocolConnector(
new SocketConnector() );
connector.getIoConnector().getFilterChain().addFirst( "threadPool",
ioThreadPoolFilter );
connector.getFilterChain().addFirst( "threadPool",
protocolThreadPoolFilter );
ProtocolProvider protocolProvider = new ClientProtocolProvider( values );
ProtocolSession session;
for( ;; )
{
try
{
session = connector.connect( new InetSocketAddress( HOSTNAME,
PORT ), CONNECT_TIMEOUT, protocolProvider );
break;
}
catch( IOException e )
{