use of com.zx.sms.codec.sgip12.msg.SgipUnbindResponseMessage in project SMSGate by Lihuanghe.
the class SgipUnbindRequestMessageHandler method channelRead0.
@Override
protected void channelRead0(final ChannelHandlerContext ctx, SgipUnbindRequestMessage msg) throws Exception {
SgipUnbindResponseMessage resp = new SgipUnbindResponseMessage(msg.getHeader());
ChannelFuture future = ctx.channel().writeAndFlush(resp);
final ChannelHandlerContext finalctx = ctx;
future.addListeners(new GenericFutureListener() {
@Override
public void operationComplete(Future future) throws Exception {
ctx.executor().schedule(new Runnable() {
@Override
public void run() {
finalctx.channel().close();
}
}, 500, TimeUnit.MILLISECONDS);
}
});
}
use of com.zx.sms.codec.sgip12.msg.SgipUnbindResponseMessage in project SMSGate by Lihuanghe.
the class SgipUnbindResponseMessageCodec method decode.
@Override
protected void decode(ChannelHandlerContext ctx, Message msg, List<Object> out) throws Exception {
int commandId = msg.getHeader().getCommandId();
if (packetType.getCommandId() != commandId) {
// 不解析,交给下一个codec
out.add(msg);
return;
}
SgipUnbindResponseMessage responseMessage = new SgipUnbindResponseMessage(msg.getHeader());
responseMessage.setTimestamp(msg.getTimestamp());
out.add(responseMessage);
}
Aggregations