}
public static void main(String[] args) throws Exception {
SessionAcceptor acceptor = SessionFactory
.createSessionAcceptor(SessionType.TCP);
acceptor.setAcceptorHandler(new SessionAcceptorHandler() {
public void sessionAccepted(SessionAcceptor acceptor,
Session session) throws Exception {
session.setPacketDecoder(new ChatMessageDecoder());
session.setPacketEncoder(new ChatMessageEncoder());