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

Examples of org.apache.mina.transport.socket.nio.SocketAcceptor.bind()


        {
            addSSLSupport( chain );
        }

        // Bind
        acceptor.bind(
                new InetSocketAddress( PORT ),
                new HttpProtocolHandler(),
                config );

        System.out.println( "Listening on port " + PORT );
View Full Code Here


                    "codec",
                    new ProtocolCodecFilter( new ObjectSerializationCodecFactory() ) );
        }
        cfg.getFilterChain().addLast( "logger", new LoggingFilter() );

        acceptor.bind(
                new InetSocketAddress( SERVER_PORT ),
                new ServerSessionHandler( ), cfg );

        System.out.println( "Listening on port " + SERVER_PORT );
    }
View Full Code Here

            String host = InetAddress.getLocalHost().getHostName();
            ClusteredProtocolHandler handler = new ClusteredProtocolHandler(new InetSocketAddress(host, port));
            if (!connectorConfig.enableSSL)
            {
                acceptor.bind(new InetSocketAddress(port), handler, sconfig);
                _logger.info("Qpid.AMQP listening on non-SSL port " + port);
                handler.connect(commandLine.getOptionValue("j"));
            }
            else
            {
View Full Code Here

                handler.connect(commandLine.getOptionValue("j"));
            }
            else
            {
                ClusteredProtocolHandler sslHandler = new ClusteredProtocolHandler(handler);
                acceptor.bind(new InetSocketAddress(connectorConfig.sslPort), sslHandler, sconfig);
                _logger.info("Qpid.AMQP listening on SSL port " + connectorConfig.sslPort);
            }
        }
        catch (IOException e)
        {
View Full Code Here

    public static final <E> void accept(SocketAddress address,
                                        Binding<E,java.nio.ByteBuffer> binding)
        throws IOException
    {
        IoAcceptor acceptor = new SocketAcceptor();
        acceptor.bind(address, new MinaHandler<E>(binding));
    }

    public static final <E> E connect(String host, int port,
                                      Binding<E,java.nio.ByteBuffer> binding)
    {
View Full Code Here

        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 )
            {
View Full Code Here

                new ServerToProxyIoHandler(), connector,
                new InetSocketAddress( args[ 1 ],
                        Integer.parseInt( args[ 2 ] ) ) );
       
        // Start proxy.
        acceptor.bind( new InetSocketAddress( Integer.parseInt( args[ 0 ] ) ), handler );

        System.out.println( "Listening on port " + Integer.parseInt( args[ 0 ] ) );
    }
   
}
View Full Code Here

    public static void main( String[] args ) throws Throwable
    {
        // Create ServiceRegistry.
        IoAcceptor acceptor = new SocketAcceptor();

        acceptor.bind(
                new InetSocketAddress( SERVER_PORT ),
                new ServerSessionHandler( USE_CUSTOM_CODEC ) );

        System.out.println( "Listening on port " + SERVER_PORT );
    }
View Full Code Here

        }
       
        addLogger( chain );
       
        // Bind
        acceptor.bind(
                new InetSocketAddress( PORT ),
                new EchoProtocolHandler(),
                config );

        System.out.println( "Listening on port " + PORT );
View Full Code Here

        {
            addSSLSupport( chain );
        }

        // Bind
        acceptor.bind(
                new InetSocketAddress( PORT ),
                new HttpProtocolHandler(),
                config );

        System.out.println( "Listening on port " + PORT );
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.