MINA2.0 实例--TimeServer(三)

2014-11-24 10:11:59 · 作者: · 浏览: 2
.forName( "UTF-8" ))));

// Attach the business logic to the server
acceptor.setHandler( new TimeServerHandler() );

// Configurate the buffer size and the iddle time
acceptor.getSessionConfig().setReadBufferSize( 2048 );
acceptor.getSessionConfig().setIdleTime( IdleStatus.BOTH_IDLE, 10 );

// And bind !
acceptor.bind( new InetSocketAddress(PORT) );
}
}

over!