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

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

Introduction

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

Prototype

public boolean isComplete() 

Source Link

Document

Return true if this message is complete.

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 .  ja v  a 2 s  .c o 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);
    // }
}