Search in sources :

Example 1 with SMGPSessionLoginManager

use of com.zx.sms.session.smgp.SMGPSessionLoginManager in project SMSGate by Lihuanghe.

the class SMGPClientEndpointConnector method doinitPipeLine.

@Override
protected void doinitPipeLine(ChannelPipeline pipeline) {
    EndpointEntity entity = getEndpointEntity();
    pipeline.addLast(GlobalConstance.IdleCheckerHandlerName, new IdleStateHandler(0, 0, entity.getIdleTimeSec(), TimeUnit.SECONDS));
    pipeline.addLast("SmgpServerIdleStateHandler", GlobalConstance.smgpidleHandler);
    pipeline.addLast(SMGPCodecChannelInitializer.pipeName(), new SMGPCodecChannelInitializer((int) ((SMGPEndpointEntity) entity).getClientVersion()));
    pipeline.addLast("sessionLoginManager", new SMGPSessionLoginManager(getEndpointEntity()));
}
Also used : IdleStateHandler(io.netty.handler.timeout.IdleStateHandler) SMGPSessionLoginManager(com.zx.sms.session.smgp.SMGPSessionLoginManager) EndpointEntity(com.zx.sms.connect.manager.EndpointEntity)

Example 2 with SMGPSessionLoginManager

use of com.zx.sms.session.smgp.SMGPSessionLoginManager in project SMSGate by Lihuanghe.

the class SMGPServerEndpointConnector method doinitPipeLine.

@Override
protected void doinitPipeLine(ChannelPipeline pipeline) {
    super.doinitPipeLine(pipeline);
    EndpointEntity entity = getEndpointEntity();
    pipeline.addLast(GlobalConstance.IdleCheckerHandlerName, new IdleStateHandler(0, 0, entity.getIdleTimeSec(), TimeUnit.SECONDS));
    pipeline.addLast("SmgpServerIdleStateHandler", GlobalConstance.smgpidleHandler);
    // 默认使用3.0协议,用户登陆后再更换为正确的协议
    pipeline.addLast(SMGPCodecChannelInitializer.pipeName(), new SMGPCodecChannelInitializer(0x30));
    pipeline.addLast("sessionLoginManager", new SMGPSessionLoginManager(getEndpointEntity()));
}
Also used : IdleStateHandler(io.netty.handler.timeout.IdleStateHandler) SMGPSessionLoginManager(com.zx.sms.session.smgp.SMGPSessionLoginManager) EndpointEntity(com.zx.sms.connect.manager.EndpointEntity)

Aggregations

EndpointEntity (com.zx.sms.connect.manager.EndpointEntity)2 SMGPSessionLoginManager (com.zx.sms.session.smgp.SMGPSessionLoginManager)2 IdleStateHandler (io.netty.handler.timeout.IdleStateHandler)2