if ( ( transports == null ) || ( transports.size() == 0 ) )
{
// Default to UDP with port 53
// We have to create a DatagramAcceptor
UdpTransport transport = new UdpTransport( DEFAULT_IP_PORT );
setTransports( transport );
DatagramAcceptor acceptor = (DatagramAcceptor)transport.getAcceptor();
// Set the handler
acceptor.setHandler( new DnsProtocolHandler( this, store ) );
// Allow the port to be reused even if the socket is in TIME_WAIT state
((DatagramSessionConfig)acceptor.getSessionConfig()).setReuseAddress( true );
// Start the listener
acceptor.bind();
}
else
{
for ( Transport transport:transports )
{
// Get the acceptor
IoAcceptor acceptor = transport.getAcceptor();
// Set the handler
acceptor.setHandler( new DnsProtocolHandler( this, store ) );
if ( transport instanceof UdpTransport )