Example usage for io.netty.channel.sctp SctpMessage streamIdentifier

List of usage examples for io.netty.channel.sctp SctpMessage streamIdentifier

Introduction

In this page you can find the example usage for io.netty.channel.sctp SctpMessage streamIdentifier.

Prototype

int streamIdentifier

To view the source code for io.netty.channel.sctp SctpMessage streamIdentifier.

Click Source Link

Usage

From source file:org.mobicents.protocols.sctp.netty.NettySctpChannelInboundHandlerAdapter.java

License:Open Source License

@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) {
    // try {// w  w w .j a va  2 s.  co m
    PayloadData payload;
    if (this.association.getIpChannelType() == IpChannelType.SCTP) {
        SctpMessage sctpMessage = (SctpMessage) msg;
        ByteBuf byteBuf = sctpMessage.content();
        payload = new PayloadData(byteBuf.readableBytes(), byteBuf, sctpMessage.isComplete(),
                sctpMessage.isUnordered(), sctpMessage.protocolIdentifier(), sctpMessage.streamIdentifier());
    } else {
        ByteBuf byteBuf = (ByteBuf) msg;
        payload = new PayloadData(byteBuf.readableBytes(), byteBuf, true, false, 0, 0);
    }

    if (logger.isDebugEnabled()) {
        logger.debug(String.format("Rx : Ass=%s %s", this.association.getName(), payload));
    }

    this.association.read(payload);
    // } finally {
    // ReferenceCountUtil.release(msg);
    // }
}