Ashish wrote:
Was browsing ApacheDS DNS code and found this construct in
org.apache.directory.server.dns.DnsServer.java

public void start() throws IOException
    {
        RecordStore store = new JndiRecordStoreImpl(
getSearchBaseDn(), getSearchBaseDn(), getDirectoryService() );

        if ( getDatagramAcceptor() != null )
        {
            DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
            getDatagramAcceptor().bind( new InetSocketAddress(
getIpPort() ), new DnsProtocolHandler( this, store ), udpConfig );
        }

        if ( getSocketAcceptor() != null )
        {
            SocketAcceptorConfig tcpConfig = new SocketAcceptorConfig();
            tcpConfig.setDisconnectOnUnbind( false );
            tcpConfig.setReuseAddress( true );
            getSocketAcceptor().bind( new InetSocketAddress(
getIpPort() ), new DnsProtocolHandler( this, store ), tcpConfig );
        }

        LOG.info( "DSN service started." );
        System.out.println( "DSN service started." );
    }

Got these queries

Q1. Using this construct, will we be able to receive TCP as well as
UDP traffic on the same port? or I am missing something
Yes you can ! DatagramSocket and tp Socket are different beasts.
Q2. ApacheDS DNS implementation uses per session FilterChain (set in
IoHandler), based on the session transport. Is the understanding
correct that IOFilterChains are per session?
All the chains are per session. If fact, they are copied from the generic definition of the chain. (it's not only the case for DNS, it's the way MINA handles chains)
Can't the DNS and other protocol implementation in ApacheDS projects
be made subproject(s) in Apache MINA?
Well, this is a possibility. Initially, as DNS requires some storage, it was based on ADS to provide such a storage. Also keep in mind that back in 2005 and up to 2007, MINA was an ADS's subproject...


--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to