if ( ( transports == null ) || ( transports.size() == 0 ) )
{
// Default to UDP with port 88
// We have to create a DatagramAcceptor
UdpTransport transport = new UdpTransport( DEFAULT_IP_PORT );
setTransports( transport );
DatagramAcceptor acceptor = (DatagramAcceptor)transport.getAcceptor();
// Inject the chain
IoFilterChainBuilder udpChainBuilder = new DefaultIoFilterChainBuilder();
((DefaultIoFilterChainBuilder)udpChainBuilder).addFirst( "codec",
new ProtocolCodecFilter(
KerberosProtocolCodecFactory.getInstance() ) );
acceptor.setFilterChainBuilder( udpChainBuilder );
// Inject the protocol handler
acceptor.setHandler( new KerberosProtocolHandler( this, store ) );
// Bind to the configured address
acceptor.bind();
}
else
{
// Kerberos can use UDP or TCP
for ( Transport transport:transports )
{
IoAcceptor acceptor = transport.getAcceptor();
// Now, configure the acceptor
// Inject the chain
IoFilterChainBuilder chainBuilder = new DefaultIoFilterChainBuilder();