Search in sources :

Example 1 with CMPPSubmitLongMessageHandler

use of com.zx.sms.handler.cmpp.CMPPSubmitLongMessageHandler in project SMSGate by Lihuanghe.

the class CMPPServerChildEndpointConnector method doBindHandler.

@Override
protected void doBindHandler(ChannelPipeline pipe, EndpointEntity cmppentity) {
    CMPPEndpointEntity entity = (CMPPEndpointEntity) cmppentity;
    // 修改连接空闲时间,使用server.xml里配置的连接空闲时间生效
    if (entity instanceof CMPPServerChildEndpointEntity) {
        ChannelHandler handler = pipe.get(GlobalConstance.IdleCheckerHandlerName);
        if (handler != null) {
            pipe.replace(handler, GlobalConstance.IdleCheckerHandlerName, new IdleStateHandler(0, 0, entity.getIdleTimeSec(), TimeUnit.SECONDS));
        }
    }
    // 处理长短信
    pipe.addLast("CMPPDeliverLongMessageHandler", new CMPPDeliverLongMessageHandler(entity));
    pipe.addLast("CMPPSubmitLongMessageHandler", new CMPPSubmitLongMessageHandler(entity));
    pipe.addLast("CmppActiveTestRequestMessageHandler", GlobalConstance.activeTestHandler);
    pipe.addLast("CmppActiveTestResponseMessageHandler", GlobalConstance.activeTestRespHandler);
    pipe.addLast("CmppTerminateRequestMessageHandler", GlobalConstance.terminateHandler);
    pipe.addLast("CmppTerminateResponseMessageHandler", GlobalConstance.terminateRespHandler);
}
Also used : CMPPDeliverLongMessageHandler(com.zx.sms.handler.cmpp.CMPPDeliverLongMessageHandler) IdleStateHandler(io.netty.handler.timeout.IdleStateHandler) ChannelHandler(io.netty.channel.ChannelHandler) CMPPSubmitLongMessageHandler(com.zx.sms.handler.cmpp.CMPPSubmitLongMessageHandler)

Example 2 with CMPPSubmitLongMessageHandler

use of com.zx.sms.handler.cmpp.CMPPSubmitLongMessageHandler in project SMSGate by Lihuanghe.

the class CMPPClientEndpointConnector method doBindHandler.

@Override
protected void doBindHandler(ChannelPipeline pipe, EndpointEntity cmppentity) {
    CMPPEndpointEntity entity = (CMPPEndpointEntity) cmppentity;
    if (entity instanceof ClientEndpoint) {
        pipe.addAfter(GlobalConstance.codecName, "reWriteSubmitMsgSrcHandler", new ReWriteSubmitMsgSrcHandler(entity));
    }
    // 处理长短信
    pipe.addLast("CMPPDeliverLongMessageHandler", new CMPPDeliverLongMessageHandler(entity));
    pipe.addLast("CMPPSubmitLongMessageHandler", new CMPPSubmitLongMessageHandler(entity));
    pipe.addLast("CmppActiveTestRequestMessageHandler", GlobalConstance.activeTestHandler);
    pipe.addLast("CmppActiveTestResponseMessageHandler", GlobalConstance.activeTestRespHandler);
    pipe.addLast("CmppTerminateRequestMessageHandler", GlobalConstance.terminateHandler);
    pipe.addLast("CmppTerminateResponseMessageHandler", GlobalConstance.terminateRespHandler);
}
Also used : ReWriteSubmitMsgSrcHandler(com.zx.sms.handler.cmpp.ReWriteSubmitMsgSrcHandler) CMPPDeliverLongMessageHandler(com.zx.sms.handler.cmpp.CMPPDeliverLongMessageHandler) ClientEndpoint(com.zx.sms.connect.manager.ClientEndpoint) CMPPSubmitLongMessageHandler(com.zx.sms.handler.cmpp.CMPPSubmitLongMessageHandler)

Aggregations

CMPPDeliverLongMessageHandler (com.zx.sms.handler.cmpp.CMPPDeliverLongMessageHandler)2 CMPPSubmitLongMessageHandler (com.zx.sms.handler.cmpp.CMPPSubmitLongMessageHandler)2 ClientEndpoint (com.zx.sms.connect.manager.ClientEndpoint)1 ReWriteSubmitMsgSrcHandler (com.zx.sms.handler.cmpp.ReWriteSubmitMsgSrcHandler)1 ChannelHandler (io.netty.channel.ChannelHandler)1 IdleStateHandler (io.netty.handler.timeout.IdleStateHandler)1