Examples of SctpChannel


Examples of com.sun.nio.sctp.SctpChannel

            i.remove();
            if ( key.isReadable() ) {
              SCTPMessageChannel channel = (SCTPMessageChannel) key.attachment();
              channel.readMessages();
            } else if (key.isAcceptable()) {
              SctpChannel ch = sctpServerChannel.accept();
              SCTPMessageChannel c = new SCTPMessageChannel( this, ch );
              channels.add( c );
            }
          }
        }
View Full Code Here

Examples of com.sun.nio.sctp.SctpChannel

                    try {
                        if (selector.select(500) > 0) {
                            selector.selectedKeys().clear();
                        }

                        SctpChannel acceptedSocket = channel.serverChannel.accept();
                        if (acceptedSocket != null) {
                            registerAcceptedChannel(acceptedSocket, currentThread);
                        }
                    } catch (SocketTimeoutException e) {
                        // Thrown every second to get ClosedChannelException
View Full Code Here

Examples of com.sun.nio.sctp.SctpChannel

    private static final InternalLogger logger =
        InternalLoggerFactory.getInstance(SctpClientChannel.class);

    private static SctpChannel newChannael() {
        SctpChannel underlayingChannel;
        try {
            underlayingChannel = SctpChannel.open();
        } catch (IOException e) {
            throw new ChannelException("Failed to open a sctp channel.", e);
        }

        boolean success = false;
        try {
            underlayingChannel.configureBlocking(false);
            success = true;
        } catch (IOException e) {
            throw new ChannelException("Failed to enter non-blocking mode.", e);
        } finally {
            if (!success) {
                try {
                    underlayingChannel.close();
                } catch (IOException e) {
                    if (logger.isWarnEnabled()) {
                        logger.warn(
                                "Failed to close a partially initialized socket.",
                                e);
View Full Code Here

Examples of com.sun.nio.sctp.SctpChannel

            i.remove();
            if ( key.isReadable() ) {
              SCTPMessageChannel channel = (SCTPMessageChannel) key.attachment();
              channel.readMessages();
            } else if (key.isAcceptable()) {
              SctpChannel ch = sctpServerChannel.accept();
              SCTPMessageChannel c = new SCTPMessageChannel( this, ch );
              channels.add( c );
            }
          }
        }
View Full Code Here

Examples of io.netty.channel.sctp.SctpChannel

    @Override
    protected Object decode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception {
        if (!(msg instanceof SctpFrame)) {
            return msg;
        }
        final SctpChannel sctpChannel = (SctpChannel) channel;
        final SctpFrame sctpFrame = (SctpFrame) msg;

        if (inboundStreamFilter.filter(sctpChannel, sctpFrame)) {

            final boolean complete = sctpFrame.getMessageInfo().isComplete();
View Full Code Here

Examples of io.netty.channel.sctp.SctpChannel

    @Override
    protected Object encode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception {
        if (!(msg instanceof ChannelBuffer)) {
            return msg;
        } else {
            SctpChannel sctpChannel = (SctpChannel) channel;
            final int streamIdentifier = sctpWriteStreamSelector.streamIdentifier(sctpChannel, msg);
            return new SctpFrame(protocolIdentifier, streamIdentifier, (ChannelBuffer) msg);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.