7273747576777879808182
public void sessionAccepted(SessionAcceptor acceptor, Session session) throws Exception { startSession(session); } }); acceptor.start(); if (acceptor.isStarted()) print(); } private static void print() {
5152535455565758596061
session.setSessionHandler(handler); session.start(); } }); acceptor.start(); if (acceptor.isStarted()) System.out.println(serviceType + " listen on " + acceptor.getListenAddress()); } }
123124125126127128129130131132133
session.setPacketDecoder(new FileTransferMessageDecoder()); session.setSessionHandler(new FileTransferHandler()); session.start(); } }); acceptor.start(); if (acceptor.isStarted()) System.out.println("FileTransferServer listen on " + acceptor.getListenAddress()); }
96979899100101102103104105106
public void exceptionCaught(SessionAcceptor acceptor, Throwable cause) { System.err.println(cause); } }); acceptor.start(); if (acceptor.isStarted()) System.out.println("ChatServer listen on " + acceptor.getListenAddress()); } }