Package org.apache.mina.common

Examples of org.apache.mina.common.ConnectFuture.join()


            LOG.debug("Creating connector to address: {} using connector: {} timeout: {} millis.", new Object[]{address, connector, timeout});
        }
        IoHandler ioHandler = new ResponseHandler(getEndpoint());
        // connect and wait until the connection is established
        ConnectFuture future = connector.connect(address, ioHandler, getEndpoint().getConnectorConfig());
        future.join();
        session = future.getSession();
    }

    /**
     * Handles response from session writes
View Full Code Here


            LOG.debug("Creating connector to address: {} using connector: {} timeout: {} millis.", new Object[]{address, connector, timeout});
        }
        IoHandler ioHandler = new ResponseHandler(getEndpoint());
        // connect and wait until the connection is established
        ConnectFuture future = connector.connect(address, ioHandler, getEndpoint().getConnectorConfig());
        future.join();
        session = future.getSession();
    }

    /**
     * Handles response from session writes
View Full Code Here

        _size = size;
        AMQDataBlock block = BasicDeliverTest.getDataBlock(size);

        InetSocketAddress address = new InetSocketAddress(host, port);
        ConnectFuture future = new SocketConnector().connect(address, this);
        future.join();
        _session = future.getSession();

        _start = System.currentTimeMillis();
        for(int i = 0; i < count; i++)
        {
View Full Code Here

            public void messageReceived(IoSession ioSession, Object object) throws Exception {
                super.messageReceived(ioSession, object);    /** TODO */
            }
        };
        ConnectFuture future = connector.connect(address, ioHandler, endpoint.getConfig());
        future.join();
        session = future.getSession();
    }

    @Override
    protected void doStop() throws Exception {
View Full Code Here

            {
                ConnectFuture future = connector.connect(
                        new InetSocketAddress( HOSTNAME, PORT ),
                        new ClientSessionHandler( USE_CUSTOM_CODEC, values ) );
               
                future.join();
                session = future.getSession();
                break;
            }
            catch( IOException e )
            {
View Full Code Here

        // Connect to the server.
        VmPipeConnector connector = new VmPipeConnector();
        ConnectFuture future = connector.connect( address,
                                                  new TennisPlayer() );
        future.join();
        IoSession session = future.getSession();

        // Send the first ping message
        session.write( new TennisBall( 10 ) );
View Full Code Here

        if( !useLocalAddress )
        {
            ConnectFuture future = connector.connect(
                    new InetSocketAddress( "localhost", port ),
                    handler );
            future.join();
            session = future.getSession();
        }
        else
        {
            int clientPort = port;
View Full Code Here

                {
                    ConnectFuture future = connector.connect(
                            new InetSocketAddress( "localhost", port ),
                            new InetSocketAddress( clientPort ),
                            handler );
                    future.join();
                    session = future.getSession();
                    break;
                }
                catch( IOException e )
                {
View Full Code Here

        // Start communication.
        ConnectFuture cf = connector.connect(new InetSocketAddress(
                args[0], Integer.parseInt(args[1])), new NetCatProtocolHandler());
       
        // Wait for the connection attempt to be finished.
        cf.join();
        cf.getSession();
    }
}
View Full Code Here

                                fail( "unexpected message received " + message );
                            }
                        }
                    } );

                    c2Future.join();

                    latch.await();

                    c2Future.getSession().write( "please don't deadlock via c2" );
                } else {
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.