Search in sources :

Example 1 with SessionLoginManager

use of com.zx.sms.session.cmpp.SessionLoginManager in project SMSGate by Lihuanghe.

the class CMPPServerEndpointConnector method doinitPipeLine.

@Override
protected void doinitPipeLine(ChannelPipeline pipeline) {
    super.doinitPipeLine(pipeline);
    CMPPCodecChannelInitializer codec = null;
    if (getEndpointEntity() instanceof CMPPEndpointEntity) {
        pipeline.addLast(GlobalConstance.IdleCheckerHandlerName, new IdleStateHandler(0, 0, getEndpointEntity().getIdleTimeSec(), TimeUnit.SECONDS));
        codec = new CMPPCodecChannelInitializer(((CMPPEndpointEntity) getEndpointEntity()).getVersion());
    } else {
        pipeline.addLast(GlobalConstance.IdleCheckerHandlerName, new IdleStateHandler(0, 0, 30, TimeUnit.SECONDS));
        codec = new CMPPCodecChannelInitializer();
    }
    pipeline.addLast("CmppServerIdleStateHandler", GlobalConstance.idleHandler);
    pipeline.addLast(codec.pipeName(), codec);
    pipeline.addLast("sessionLoginManager", new SessionLoginManager(getEndpointEntity()));
}
Also used : SessionLoginManager(com.zx.sms.session.cmpp.SessionLoginManager) IdleStateHandler(io.netty.handler.timeout.IdleStateHandler)

Example 2 with SessionLoginManager

use of com.zx.sms.session.cmpp.SessionLoginManager in project SMSGate by Lihuanghe.

the class CMPPClientEndpointConnector method doinitPipeLine.

@Override
protected void doinitPipeLine(ChannelPipeline pipeline) {
    CMPPCodecChannelInitializer codec = null;
    EndpointEntity entity = getEndpointEntity();
    if (entity instanceof CMPPEndpointEntity) {
        pipeline.addLast(GlobalConstance.IdleCheckerHandlerName, new IdleStateHandler(0, 0, ((CMPPEndpointEntity) getEndpointEntity()).getIdleTimeSec(), TimeUnit.SECONDS));
        codec = new CMPPCodecChannelInitializer(((CMPPEndpointEntity) getEndpointEntity()).getVersion());
    } else {
        pipeline.addLast(GlobalConstance.IdleCheckerHandlerName, new IdleStateHandler(0, 0, 30, TimeUnit.SECONDS));
        codec = new CMPPCodecChannelInitializer();
    }
    pipeline.addLast("CmppServerIdleStateHandler", GlobalConstance.idleHandler);
    pipeline.addLast(codec.pipeName(), codec);
    pipeline.addLast("sessionLoginManager", new SessionLoginManager(getEndpointEntity()));
}
Also used : SessionLoginManager(com.zx.sms.session.cmpp.SessionLoginManager) IdleStateHandler(io.netty.handler.timeout.IdleStateHandler) EndpointEntity(com.zx.sms.connect.manager.EndpointEntity)

Aggregations

SessionLoginManager (com.zx.sms.session.cmpp.SessionLoginManager)2 IdleStateHandler (io.netty.handler.timeout.IdleStateHandler)2 EndpointEntity (com.zx.sms.connect.manager.EndpointEntity)1