Examples of awaitUninterruptibly()


Examples of org.apache.mina.core.future.ConnectFuture.awaitUninterruptibly()

    connector.getFilterChain().addLast( "logger", new LoggingFilter() );
    connector.getFilterChain().addLast( "codec", new ProtocolCodecFilter( new TextLineCodecFactory( Charset.forName( "UTF-8" ))));

    // Start communication.
    ConnectFuture cf = connector.connect(new InetSocketAddress("localhost", 9123));
    cf.awaitUninterruptibly();

    IoSession session = cf.getSession();

    // send a message
    session.write("Hello World!\r");
View Full Code Here

Examples of org.apache.mina.core.future.ConnectFuture.awaitUninterruptibly()

        // And create the connection future
        ConnectFuture connectionFuture = connector.connect( address );

        // Wait until it's established
        connectionFuture.awaitUninterruptibly();

        boolean isConnected = connectionFuture.isConnected();

        if ( !isConnected )
        {
View Full Code Here

Examples of org.apache.mina.core.future.ConnectFuture.awaitUninterruptibly()

        // And create the connection future
        ConnectFuture connectionFuture = connector.connect( address );

        // Wait until it's established
        connectionFuture.awaitUninterruptibly();

        boolean isConnected = connectionFuture.isConnected();

        if ( !isConnected )
        {
View Full Code Here

Examples of org.apache.mina.core.future.IoFuture.awaitUninterruptibly()

            IoFuture f = i.next();
            do {
                if (interruptable) {
                    lastComplete = f.await(waitTime);
                } else {
                    lastComplete = f.awaitUninterruptibly(waitTime);
                }
               
                waitTime = timeoutMillis - (System.currentTimeMillis() - startTime);

                if (lastComplete || waitTime <= 0) {
View Full Code Here

Examples of org.apache.mina.core.future.ReadFuture.awaitUninterruptibly()

            if (connectFuture.getException() != null) {
                throw connectFuture.getException();
            }
            connectFuture.getSession().getConfig().setUseReadOperation(true);
            ReadFuture readFuture = connectFuture.getSession().read();
            readFuture.awaitUninterruptibly();
            if (readFuture.getException() != null) {
                throw readFuture.getException();
            }
            IoBuffer message = (IoBuffer)readFuture.getMessage();
            assertEquals(1, message.remaining());
View Full Code Here

Examples of org.apache.mina.core.future.WriteFuture.awaitUninterruptibly()

        long localTimeout = timeout;

        while ( localTimeout > 0 )
        {
            // Wait only 100 ms
            boolean done = writeFuture.awaitUninterruptibly( 100 );

            if ( done )
            {
                return;
            }
View Full Code Here

Examples of org.apache.mina.core.future.WriteFuture.awaitUninterruptibly()

     */
    public static void sendShutdownResponse( IoSession requestor, int messageId )
    {
        GracefulShutdownResponse msg = new GracefulShutdownResponseImpl( messageId, ResultCodeEnum.SUCCESS );
        WriteFuture future = requestor.write( msg );
        future.awaitUninterruptibly();
        if ( future.isWritten() )
        {
            if ( LOG.isInfoEnabled() )
            {
                LOG.info( "Sent GracefulShutdownResponse to client: " + requestor.getRemoteAddress() );
View Full Code Here

Examples of org.apache.mina.core.future.WriteFuture.awaitUninterruptibly()

        long localTimeout = timeout;

        while ( localTimeout > 0 )
        {
            // Wait only 100 ms
            boolean done = writeFuture.awaitUninterruptibly( 100 );

            if ( done )
            {
                return;
            }
View Full Code Here

Examples of org.elasticsearch.common.netty.channel.ChannelFuture.awaitUninterruptibly()

    }

    private NodeChannels connectToChannelsLight(DiscoveryNode node) {
        InetSocketAddress address = ((InetSocketTransportAddress) node.address()).address();
        ChannelFuture connect = clientBootstrap.connect(address);
        connect.awaitUninterruptibly((long) (connectTimeout.millis() * 1.5));
        if (!connect.isSuccess()) {
            throw new ConnectTransportException(node, "connect_timeout[" + connectTimeout + "]", connect.getCause());
        }
        Channel[] channels = new Channel[1];
        channels[0] = connect.getChannel();
View Full Code Here

Examples of org.jboss.netty.channel.ChannelFuture.awaitUninterruptibly()

        // Make a new connection.
        ChannelFuture connectFuture =
            bootstrap.connect(new InetSocketAddress(host, port));

        // Wait until the connection is made successfully.
        Channel channel = connectFuture.awaitUninterruptibly().getChannel();

        // Get the handler instance to retrieve the answer.
        FactorialClientHandler handler =
            (FactorialClientHandler) channel.getPipeline().getLast();
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.