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 )
{
// Allow the port to be reused even if the socket is in TIME_WAIT state
( ( DatagramSessionConfig ) acceptor.getSessionConfig() ).setReuseAddress( true );