public class SctpOutboundByteStreamHandler extends MessageToMessageEncoder<ByteBuf>
ByteBuf转换为SctpMessage ,并通过具有给定协议标识符的特定流发送它。
通过将unordered = true传递给构造函数,可以请求所有消息的无序传递。
ChannelHandler.Sharable| Constructor and Description |
|---|
SctpOutboundByteStreamHandler(int streamIdentifier, int protocolIdentifier) |
SctpOutboundByteStreamHandler(int streamIdentifier, int protocolIdentifier, boolean unordered) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
encode(ChannelHandlerContext ctx, ByteBuf 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 SctpOutboundByteStreamHandler(int streamIdentifier,
int protocolIdentifier)
streamIdentifier - 流号码,这应该是> = 0或<=最大流号码的关联。
protocolIdentifier - 支持的应用程序协议ID。
public SctpOutboundByteStreamHandler(int streamIdentifier,
int protocolIdentifier,
boolean unordered)
streamIdentifier - 流号码,这应该是> = 0或<=最大关联流号码。
protocolIdentifier - 支持的应用程序协议ID。
unordered - 如果为true,则将使用U(无序)标志集发送SCTP数据块。
protected void encode(ChannelHandlerContext ctx, ByteBuf msg, java.util.List<java.lang.Object> out) throws java.lang.Exception
MessageToMessageEncoder
encode在课堂上
MessageToMessageEncoder<ByteBuf>
ctx - 此MessageToMessageEncoder所属的ChannelHandlerContext
msg - 要编码到另一个的消息
out - 应该添加编码味精的
List需要做某种聚合
java.lang.Exception - 发生错误时抛出
Copyright © 2008–2018 The Netty Project. All rights reserved.