Skip to content

Instantly share code, notes, and snippets.

@daschl
Created June 16, 2014 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daschl/18bb0c18cba5990b4b88 to your computer and use it in GitHub Desktop.
Save daschl/18bb0c18cba5990b4b88 to your computer and use it in GitHub Desktop.
@Override
protected void channelRead0(ChannelHandlerContext ctx, FullBinaryMemcacheResponse msg) throws Exception {
if (msg.getStatus() == BinaryMemcacheResponseStatus.SUCCESS) {
while(msg.content().isReadable()) {
short supported = msg.content().readShort();
if (supported == 0x01) {
SupportedDatatypes dtypes = new SupportedDatatypes(true, true);
LOGGER.debug(ctx.channel().remoteAddress() + " Hello detected: " + dtypes);
ctx.fireUserEventTriggered(dtypes);
}
}
} else {
LOGGER.debug(ctx.channel().remoteAddress() + " Hello not successful (Response Status: "
+ msg.getStatus() + "), falling back to " + "no datatype.");
}
originalPromise.setSuccess();
ctx.pipeline().remove(this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment