Examples of connect()


Examples of org.apache.mina.proxy.ProxyConnector.connect()

        logger.debug("Reconnecting to proxy ...");

        final ProxyIoSession proxyIoSession = getProxyIoSession();
        final ProxyConnector connector = proxyIoSession.getConnector();

        connector.connect(new IoSessionInitializer<ConnectFuture>() {
            public void initializeSession(final IoSession session,
                    ConnectFuture future) {
                logger.debug("Initializing new session: " + session);
                session.setAttribute(ProxyIoSession.PROXY_SESSION,
                        proxyIoSession);
View Full Code Here

Examples of org.apache.mina.transport.nio.NioTcpClient.connect()

        client.setConnectTimeoutMillis(1000);

        ServerSocket server = new ServerSocket();
        try {
            server.bind(null);
            IoFuture<IoSession> cf = client.connect(new InetSocketAddress("localhost", server.getLocalPort()));
            Thread.sleep(5000);
            IoSession session = cf.get();
            System.err.println(session);
            Assert.fail();
        } catch (ExecutionException ex) {
View Full Code Here

Examples of org.apache.mina.transport.nio.NioUdpClient.connect()

        // now connect the clients

        List<IoFuture<IoSession>> cf = new ArrayList<IoFuture<IoSession>>();
        for (int i = 0; i < CLIENT_COUNT; i++) {
            cf.add(client.connect(new InetSocketAddress("localhost", port)));
        }

        // does the session open message was fired ?
        assertTrue(openLatch.await(WAIT_TIME, TimeUnit.MILLISECONDS));
View Full Code Here

Examples of org.apache.mina.transport.socket.nio.NioDatagramConnector.connect()

    NioDatagramConnector udp = new NioDatagramConnector();
    udp.getFilterChain().addLast("codec",
        new ProtocolCodecFilter(
            new TextLineCodecFactory(Charset.forName("US-ASCII"))));
    udp.setHandler(new UdpProtocolHandler(this));
    cf = udp.connect(new InetSocketAddress(HOST, 7005));
    cf.addListener(new IoFutureListener() {
      public void operationComplete(IoFuture s) {
        try {
          if(s.getSession().isConnected()) {
            m_packetGen.setUdpSession(s.getSession());
View Full Code Here

Examples of org.apache.mina.transport.socket.nio.NioSocketConnector.connect()

    connector.setHandler(new ClientHandler());
    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
View Full Code Here

Examples of org.apache.mina.transport.socket.nio.SocketConnector.connect()

        // Set connect timeout.
        ((IoConnectorConfig) connector.getDefaultConfig())
                .setConnectTimeout(15);

        // 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

Examples of org.apache.mina.transport.vmpipe.QpidVmPipeConnector.connect()

        final VmPipeAddress address = new VmPipeAddress(_port);
        _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

Examples of org.apache.mina.transport.vmpipe.VmPipeConnector.connect()

        // Set up server
        acceptor.bind(address, new TennisPlayer());

        // 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

Examples of org.apache.oodt.cas.protocol.Protocol.connect()

            if (verifier == null || verifier.verify(protocol, site, auth)) {
              verifiedMap.put(site, factory);
              if (protocol.connected()) {
                protocol.close();
              }
              protocol.connect(site.getHost(), auth);
              return protocol;
            }
          } catch (Exception e) {
          LOG.warning("Failed to create/verify protocol from factory '"
              + factory.getClass().getCanonicalName()
View Full Code Here

Examples of org.apache.phoenix.jdbc.PhoenixTestDriver.connect()

     */
    protected static PhoenixTestDriver initAndRegisterDriver(String url, ReadOnlyProps props) throws Exception {
        PhoenixTestDriver driver = new PhoenixTestDriver(props);
        DriverManager.registerDriver(driver);
        Assert.assertTrue(DriverManager.getDriver(url) == driver);
        Connection conn = driver.connect(url, PropertiesUtil.deepCopy(TEST_PROPERTIES));
        conn.close();
        return driver;
    }
   
    //Close and unregister the driver.
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.