Package org.apache.mina.common

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


                    {
                        session.close();
                    }
                });

        future.join();
        future.getSession().getCloseFuture().join();
        acceptor.unbindAll();
       
        // sessionClosed() might not be invoked yet
        // even if the connection is closed.
View Full Code Here


        _logger.info("Attempting connection to " + address);
        _networkDriver = new MINANetworkDriver(ioConnector, protocolHandler);
        protocolHandler.setNetworkDriver(_networkDriver);
        ConnectFuture future = ioConnector.connect(address, _networkDriver);
        // wait for connection to complete
        future.join();
        // we call getSession which throws an IOException if there has been an error connecting
        future.getSession();
        _networkDriver.setProtocolEngine(protocolHandler);
    }
}
View Full Code Here

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

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

        {
            ((SocketConnector) _socketConnector).setWorkerTimeout(0);
        }

        ConnectFuture future = _socketConnector.connect(new InetSocketAddress(destination, port), this, cfg);
        future.join();
        if (!future.isConnected())
        {
            throw new OpenException("Could not open connection", _lastException);
        }
        _ioSession = future.getSession();
View Full Code Here

            LOG.debug("Creating connector to address: " + address + " using connector: " + connector + " timeout: " + timeout + " millis.");
        }
        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: " + address + " using connector: " + connector + " timeout: " + timeout + " millis.");
        }
        IoHandler ioHandler = new ResponseHandler(endpoint);
        // connect and wait until the connection is established
        ConnectFuture future = connector.connect(address, ioHandler, endpoint.getConnectorConfig());
        future.join();
        session = future.getSession();
    }

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

        {
            ((SocketConnector) _socketConnector).setWorkerTimeout(0);
        }

        ConnectFuture future = _socketConnector.connect(new InetSocketAddress(destination, port), this, cfg);
        future.join();
        if (!future.isConnected())
        {
            throw new OpenException("Could not open connection", _lastException);
        }
        _ioSession = future.getSession();
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( RuntimeIOException e )
                {
View Full Code Here

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

    /**
     * Handles response from session writes
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.