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

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

Introduction

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

Prototype

int protocolIdentifier

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

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 {/*from   www  .java 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);
    // }
}