Search in sources :

Example 1 with MinaClientHandler

use of com.pancm.test.minatest.demo.MinaClientHandler in project pancm_project by xuwujing.

the class ClientTestServer method creatClient.

/**
 * Creat client io connector.
 *
 * @return the io connector
 */
public IoConnector creatClient() {
    IoConnector connector = new NioSocketConnector();
    connector.setConnectTimeoutMillis(30000);
    connector.getFilterChain().addLast("codec", new ProtocolCodecFilter(new ObjectSerializationCodecFactory()));
    connector.setHandler(new MinaClientHandler());
    return connector;
}
Also used : NioSocketConnector(org.apache.mina.transport.socket.nio.NioSocketConnector) MinaClientHandler(com.pancm.test.minatest.demo.MinaClientHandler) ObjectSerializationCodecFactory(org.apache.mina.filter.codec.serialization.ObjectSerializationCodecFactory) IoConnector(org.apache.mina.core.service.IoConnector) ProtocolCodecFilter(org.apache.mina.filter.codec.ProtocolCodecFilter)

Aggregations

MinaClientHandler (com.pancm.test.minatest.demo.MinaClientHandler)1 IoConnector (org.apache.mina.core.service.IoConnector)1 ProtocolCodecFilter (org.apache.mina.filter.codec.ProtocolCodecFilter)1 ObjectSerializationCodecFactory (org.apache.mina.filter.codec.serialization.ObjectSerializationCodecFactory)1 NioSocketConnector (org.apache.mina.transport.socket.nio.NioSocketConnector)1