Search in sources :

Example 6 with ConnectFuture

use of org.apache.mina.core.future.ConnectFuture in project streamsx.topology by IBMStreams.

the class TCPTestClient method connect.

public synchronized void connect() throws InterruptedException {
    for (; ; ) {
        try {
            ConnectFuture future = connector.connect(addr);
            future.awaitUninterruptibly();
            session = future.getSession();
            return;
        } catch (RuntimeIoException e) {
            System.err.println("Failed to connect.");
            e.printStackTrace();
            Thread.sleep(5000);
        }
    }
}
Also used : ConnectFuture(org.apache.mina.core.future.ConnectFuture) RuntimeIoException(org.apache.mina.core.RuntimeIoException)

Aggregations

ConnectFuture (org.apache.mina.core.future.ConnectFuture)6 InetSocketAddress (java.net.InetSocketAddress)3 KeyManagementException (java.security.KeyManagementException)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 SSLContext (javax.net.ssl.SSLContext)1 RuntimeIoException (org.apache.mina.core.RuntimeIoException)1 IoSession (org.apache.mina.core.session.IoSession)1 IoSessionInitializer (org.apache.mina.core.session.IoSessionInitializer)1 SslFilter (org.apache.mina.filter.ssl.SslFilter)1 SocketConnector (org.apache.mina.transport.socket.SocketConnector)1 NioSocketConnector (org.apache.mina.transport.socket.nio.NioSocketConnector)1