Package com.sun.nio.sctp

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


                    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

    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

            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

TOP

Related Classes of com.sun.nio.sctp.SctpChannel

Copyright © 2018 www.massapicom. 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.