@ChannelHandler.Sharable public final class MqttEncoder extends MessageToMessageEncoder<MqttMessage>
ChannelHandler.Sharable| Modifier and Type | Field and Description |
|---|---|
static MqttEncoder |
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
protected void |
encode(ChannelHandlerContext ctx, MqttMessage msg, java.util.List<java.lang.Object> out)
从一条消息编码到另一条消息。
|
acceptOutboundMessage, writebind, close, connect, deregister, disconnect, flush, readensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaught, handlerAdded, handlerRemovedpublic static final MqttEncoder INSTANCE
protected void encode(ChannelHandlerContext ctx, MqttMessage msg, java.util.List<java.lang.Object> out) throws java.lang.Exception
MessageToMessageEncoder
encode在课堂上
MessageToMessageEncoder<MqttMessage>
ctx - 这MessageToMessageEncoder所属的ChannelHandlerContext
msg - 要编码到另一个的消息
out - 应该添加编码味精的
List需要做某种聚合
java.lang.Exception - 发生错误时抛出
Copyright © 2008–2018 The Netty Project. All rights reserved.