Package org.apache.directory.server.protocol.shared.transport

Examples of org.apache.directory.server.protocol.shared.transport.UdpTransport


        {
            transport = new TcpTransport();
        }
        else if ( transportBean instanceof UdpTransportBean )
        {
            transport = new UdpTransport();
        }

        transport.setPort( transportBean.getSystemPort() );
        transport.setAddress( transportBean.getTransportAddress() );
        transport.setBackLog( transportBean.getTransportBackLog() );
View Full Code Here


       
        if ( ( transports == null ) || ( transports.size() == 0 ) )
        {
            // Default to UDP with port 123
            // We have to create a DatagramAcceptor
            UdpTransport transport = new UdpTransport( IP_PORT_DEFAULT );
            setTransports( transport );
           
            DatagramAcceptor acceptor = (DatagramAcceptor)transport.getAcceptor();

            // Set the handler
            acceptor.setHandler( ntpProtocolHandler );
   
            // Allow the port to be reused even if the socket is in TIME_WAIT state
            ((DatagramSessionConfig)acceptor.getSessionConfig()).setReuseAddress( true );
   
            // Inject the chain
            acceptor.setFilterChainBuilder( ntpChain );
           
            // Start the listener
            acceptor.bind();
        }
        else
        {
            for ( Transport transport:transports )
            {
                IoAcceptor acceptor = transport.getAcceptor();

                // Set the handler
                acceptor.setHandler( ntpProtocolHandler );
               
                if ( transport instanceof UdpTransport )
View Full Code Here

    // transport
    String transport = conf.getProperty(TRANSPORT);
    if (transport.trim().equals("TCP")) {
      kdc.addTransports(new TcpTransport(bindAddress, port, 3, 50));
    } else if (transport.trim().equals("UDP")) {
      kdc.addTransports(new UdpTransport(port));
    } else {
      throw new IllegalArgumentException("Invalid transport: " + transport);
    }
    kdc.setServiceName(conf.getProperty(INSTANCE));
    kdc.getConfig().setMaximumRenewableLifetime(
View Full Code Here

        CreateTransport[] transportBuilders = createKdcServer.transports();

        if ( transportBuilders == null )
        {
            // create only UDP transport if none specified
            UdpTransport defaultTransport = new UdpTransport( AvailablePortFinder.getNextAvailable() );
            kdcServer.addTransports( defaultTransport );
        }
        else if ( transportBuilders.length > 0 )
        {
            for ( CreateTransport transportBuilder : transportBuilders )
            {
                String protocol = transportBuilder.protocol();
                int port = transportBuilder.port();
                int nbThreads = transportBuilder.nbThreads();
                int backlog = transportBuilder.backlog();
                String address = transportBuilder.address();

                if ( port == -1 )
                {
                    port = AvailablePortFinder.getNextAvailable();
                    startPort = port + 1;
                }

                if ( protocol.equalsIgnoreCase( "TCP" ) )
                {
                    Transport tcp = new TcpTransport( address, port, nbThreads, backlog );
                    kdcServer.addTransports( tcp );
                }
                else if ( protocol.equalsIgnoreCase( "UDP" ) )
                {
                    UdpTransport udp = new UdpTransport( address, port );
                    kdcServer.addTransports( udp );
                }
                else
                {
                    throw new IllegalArgumentException( I18n.err( I18n.ERR_689, protocol ) );
View Full Code Here

    });
  }

  @Override
  public void start() throws IOException {
    UdpTransport transport = new UdpTransport("127.0.0.1", PORT);
    setTransports( transport );

    DatagramAcceptor acceptor = transport.getAcceptor();

    acceptor.setHandler(new DnsProtocolHandler(this, store) {
      @Override
      public void sessionCreated( IoSession session ) throws Exception {
        // USe our own codec to support AAAA testing
View Full Code Here

        config.setServicePrincipal("krbtgt/UNDERTOW.IO@UNDERTOW.IO");
        config.setPrimaryRealm("UNDERTOW.IO");

        config.setPaEncTimestampRequired(false);

        UdpTransport udp = new UdpTransport("0.0.0.0", KDC_PORT);
        kdcServer.addTransports(udp);

        kdcServer.setDirectoryService(directoryService);
        kdcServer.start();
    }
View Full Code Here

        CreateTransport[] transportBuilders = createKdcServer.transports();
       
        if( transportBuilders == null )
        {
            // create only UDP transport if none specified
            UdpTransport defaultTransport = new UdpTransport( AvailablePortFinder.getNextAvailable( startPort ) );
            kdcServer.addTransports( defaultTransport );
        }
        else if( transportBuilders.length > 0 )
        {
            for( CreateTransport transportBuilder : transportBuilders )
            {
                String protocol = transportBuilder.protocol();
                int port = transportBuilder.port();
                int nbThreads = transportBuilder.nbThreads();
                int backlog = transportBuilder.backlog();
                String address = transportBuilder.address();

                if ( port == -1 )
                {
                    port = AvailablePortFinder.getNextAvailable( startPort );
                    startPort = port + 1;
                }
               
                if ( protocol.equalsIgnoreCase( "TCP" ) )
                {
                    Transport tcp = new TcpTransport( address, port, nbThreads, backlog );
                    kdcServer.addTransports( tcp );
                }
                else if ( protocol.equalsIgnoreCase( "UDP" ) )
                {
                    UdpTransport udp = new UdpTransport( address, port );
                    kdcServer.addTransports( udp );
                }
                else
                {
                    throw new IllegalArgumentException( I18n.err( I18n.ERR_689, protocol ) );
View Full Code Here

TOP

Related Classes of org.apache.directory.server.protocol.shared.transport.UdpTransport

Copyright © 2018 www.massapicom. 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.