CON-Response will not be forwarded to ResponseCallbackHandler
public class IncomingMessageReliabilityHandler extends SimpleChannelHandler {
//[...]
public void messageReceived(ChannelHandlerContext ctx, MessageEvent me) throws Exception{
//incoming separate response is CON and COAPResponse
if(!(me.getMessage() instanceof CoapMessage)){
ctx.sendUpstream(me);
return;
}
CoapMessage coapMessage = (CoapMessage) me.getMessage();
if(coapMessage.getMessageType() != MsgType.CON){
ctx.sendUpstream(me);
return;
}
if(coapMessage instanceof CoapRequest){
//[...]
} else{
EmptyACKSender emptyACKSender = new EmptyACKSender((InetSocketAddress) me.getRemoteAddress(),
coapMessage.getMessageID());
//Schedule to send an empty ACK asap
executorService.schedule(emptyACKSender, 0, TimeUnit.MILLISECONDS);
}
//==> coapMessage is lost and callback will never called.
}
//[...]
}
CON-Response will not be forwarded to ResponseCallbackHandler