Package org.apache.mina.transport.socket.nio

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


        connector.setHandler(new ClientSessionHandler(values));

        IoSession session;
        for (;;) {
            try {
                ConnectFuture future = connector.connect(new InetSocketAddress(
                        HOSTNAME, PORT));
                future.awaitUninterruptibly();
                session = future.getSession();
                break;
            } catch (RuntimeIoException e) {
View Full Code Here


        // Set connect timeout.
        connector.setConnectTimeoutMillis(30*1000L);

        // Start communication.
        connector.setHandler(new NetCatProtocolHandler());
        ConnectFuture cf = connector.connect(
                new InetSocketAddress(args[0], Integer.parseInt(args[1])));

        // Wait for the connection attempt to be finished.
        cf.awaitUninterruptibly();
        cf.getSession().getCloseFuture().awaitUninterruptibly();
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.