Examples of bind()


Examples of org.apache.mina.io.IoAcceptor.bind()

    }

    public void bind( Service service, IoHandler ioHandler ) throws IOException
    {
        IoAcceptor acceptor = findIoAcceptor( service.getTransportType() );
        acceptor.bind( service.getAddress(), ioHandler );
        startThreadPools();
        services.add( service );
    }

    public synchronized void bind( Service service,
View Full Code Here

Examples of org.apache.mina.protocol.ProtocolAcceptor.bind()

    public synchronized void bind( Service service,
                                   ProtocolProvider protocolProvider ) throws IOException
    {
        ProtocolAcceptor acceptor = findProtocolAcceptor( service.getTransportType() );
        acceptor.bind( service.getAddress(), protocolProvider );
        startThreadPools();
        services.add( service );
    }

    public synchronized void unbind( Service service )
View Full Code Here

Examples of org.apache.mina.registry.ServiceRegistry.bind()

        VmPipeAddress address = new VmPipeAddress( 8080 );

        // Set up server
        Service service = new Service( "tennis", TransportType.VM_PIPE, address );
        registry.bind( service, new TennisPlayer() );

        // Connect to the server.
        VmPipeConnector connector = new VmPipeConnector();
        ProtocolSession session = connector.connect( address,
                                                     new TennisPlayer() );
View Full Code Here

Examples of org.apache.mina.registry.SimpleServiceRegistry.bind()

        VmPipeAddress address = new VmPipeAddress( 8080 );

        // Set up server
        Service service = new Service( "tennis", TransportType.VM_PIPE, address );
        registry.bind( service, new TennisPlayer() );

        // Connect to the server.
        VmPipeConnector connector = new VmPipeConnector();
        ProtocolSession session = connector.connect( address,
                                                     new TennisPlayer() );
View Full Code Here

Examples of org.apache.mina.transport.bio.BioUdpServer.bind()

                session.close(false);
            }
        });

        try {
            server.bind(5683);
            new Thread() {
                @Override
                public void run() {
                    for (;;) {
                        for (IoSession s : registration.values()) {
View Full Code Here

Examples of org.apache.mina.transport.nio.NioTcpServer.bind()

        NioTcpServer server = new NioTcpServer();

        server.setReuseAddress(true);
        server.getSessionConfig().setSslContext(createSSLContext());
        server.setIoHandler(new TestHandler());
        server.bind(new InetSocketAddress(0));
        return server.getServerSocketChannel().socket().getLocalPort();
    }

    /**
     * Starts a client which will connect twice using SSL
View Full Code Here

Examples of org.apache.mina.transport.nio.NioUdpServer.bind()

            }
        });

        try {
            final SocketAddress address = new InetSocketAddress(9999);
            server.bind(address);
            LOG.debug("Running the server for 25 sec");
            Thread.sleep(25000);
            LOG.debug("Unbinding the UDP port");
            server.unbind();
        } catch (final InterruptedException e) {
View Full Code Here

Examples of org.apache.mina.transport.socket.DatagramAcceptor.bind()

            // Inject the chain
            acceptor.setFilterChainBuilder( ntpChain );

            // Start the listener
            acceptor.bind();
        }
        else
        {
            for ( Transport transport : transports )
            {
View Full Code Here

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

            ( ( AbstractSocketSessionConfig ) acceptor.getSessionConfig() ).setReadBufferSize( 64 * 1024 );
            ( ( AbstractSocketSessionConfig ) acceptor.getSessionConfig() ).setSendBufferSize( 64 * 1024 );

            // Bind to the configured address
            acceptor.bind();

            // We are done !
            started = true;

            if ( LOG.isInfoEnabled() )
View Full Code Here

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

  public static void main(String[] args) throws Exception {
        IoAcceptor acceptor = new DatagramAcceptor();

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

        System.out.println( "Listening on port " + PORT );

  }
View Full Code Here
TOP
Copyright © 2015 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.