Examples of SocketConnector


Examples of ch.qos.logback.core.net.SocketConnector

    @Override
    public void run() {
        try {
            while (!Thread.currentThread().isInterrupted()) {
                SocketConnector connector = new DefaultSocketConnector(address, port, 0, reconnectionDelay);
                connector.setExceptionHandler(this);
                connector.setSocketFactory(SocketFactory.getDefault());

                try {
                    connectorTask = getContext().getExecutorService().submit(connector);
                } catch (RejectedExecutionException e) {
                    connectorTask = null;
View Full Code Here

Examples of org.apache.mina.io.socket.SocketConnector

    {
    }

    public void testTCP() throws Exception
    {
        IoConnector connector = new SocketConnector();
        testConnector( connector );
    }
View Full Code Here

Examples of org.apache.mina.io.socket.SocketConnector

            new SSLFilter( BogusSSLContextFactory.getInstance( true ) );
        IoAcceptor acceptor = registry.getIoAcceptor( TransportType.SOCKET );
        acceptor.getFilterChain().addLast( "SSL", acceptorSSLFilter );

        // Create a connector
        IoConnector connector = new SocketConnector();
       
        // Add an SSL filter to connector
        SSLFilter connectorSSLFilter =
            new SSLFilter( BogusSSLContextFactory.getInstance( false ) );
        connectorSSLFilter.setUseClientMode( true ); // set client mode
        connector.getFilterChain().addLast( "SSL", connectorSSLFilter );

        testConnector( connector );
    }
View Full Code Here

Examples of org.apache.mina.io.socket.SocketConnector

        // and start both.
        ioThreadPoolFilter.start();
        protocolThreadPoolFilter.start();

        IoProtocolConnector connector = new IoProtocolConnector(
                new SocketConnector() );
        connector.getIoConnector().getFilterChain().addFirst( "threadPool",
                ioThreadPoolFilter );
        connector.getFilterChain().addFirst( "threadPool",
                protocolThreadPoolFilter );
View Full Code Here

Examples of org.apache.mina.io.socket.SocketConnector

            System.out.println( Main.class.getName() + " <hostname> <port>" );
            return;
        }

        // Create TCP/IP connector.
        SocketConnector connector = new SocketConnector();

        // Start communication.
        connector.connect( new InetSocketAddress( args[ 0 ], Integer
                .parseInt( args[ 1 ] ) ), 60, new NetCatProtocolHandler() );
    }
View Full Code Here

Examples of org.apache.mina.transport.socket.SocketConnector

    public final void setConnector(final SocketConnector newConnector) {
        if (newConnector == null) {
            throw new NullPointerException("connector cannot be null");
        }

        SocketConnector oldConnector = this.connector;

        // Remove the ProxyFilter from the old filter chain builder
        if (oldConnector != null) {
            oldConnector.getFilterChain().remove(ProxyFilter.class.getName());
        }

        this.connector = newConnector;

        // Insert the ProxyFilter as the first filter in the filter chain builder
View Full Code Here

Examples of org.apache.mina.transport.socket.SocketConnector

    public void testProducerShutdownTestingWithMock() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Hello World");

        // create our mock and record expected behavior = that worker timeout should be set to 0
        SocketConnector mockConnector = createMock(SocketConnector.class);
        mockConnector.dispose(true);
        replay(mockConnector);

        // normal camel code to get a producer
        Endpoint endpoint = context.getEndpoint(
            "mina2:tcp://localhost:{{port}}?textline=true&sync=false");
View Full Code Here

Examples of org.apache.mina.transport.socket.nio.SocketConnector

            System.out.println(Main.class.getName() + " <hostname> <port>");
            return;
        }

        // Create TCP/IP connector.
        SocketConnector connector = new SocketConnector();

        // 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.socket.nio.SocketConnector

    {
        IoAcceptor acceptor = new SocketAcceptor();
        ( ( SocketAcceptorConfig ) acceptor.getDefaultConfig() ).setReuseAddress( true );
        SocketAddress address = new InetSocketAddress( "localhost", AvailablePortFinder.getNextAvailable() );

        IoConnector connector = new SocketConnector();
       
        FixedRandomInputStream stream = new FixedRandomInputStream( 4 * 1024 * 1024 );
       
        SenderHandler sender = new SenderHandler( stream );
        ReceiverHandler receiver = new ReceiverHandler( stream.size );
       
        acceptor.bind( address, sender );
       
        synchronized( sender.lock )
        {
            synchronized( receiver.lock )
            {
                connector.connect( address, receiver );
               
                sender.lock.wait();
                receiver.lock.wait();
            }
        }
View Full Code Here

Examples of org.apache.mina.transport.socket.nio.SocketConnector

            System.out.println(Main.class.getName() + " <hostname> <port>");
            return;
        }

        // Create TCP/IP connector.
        SocketConnector connector = new SocketConnector();

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