}
}).start();
/*
* 准备 SocketAtom 的生成器
*/
Borning borning = Mirror.me(klass).getBorningByArgTypes(Context.class,
Socket.class,
SocketActionTable.class);
if (borning == null) {
log.error("boring == null !!!!");
return;
}
/*
* 进入监听循环
*/
while (!context.getBoolean("stop")) {
try {
if (log.isDebugEnabled())
log.debug("Waiting for new socket");
Socket socket = server.accept();
if (context.getBoolean("stop")) {
Sockets.safeClose(socket);
break;// 监护线程也许还是睡觉,还没来得及关掉哦,所以自己检查一下
}
if (log.isDebugEnabled())
log.debug("accept a new socket, create new SocketAtom to handle it ...");
Runnable runnable = (Runnable) borning.born(new Object[]{ context,
socket,
saTable});
service.execute(runnable);
}
catch (Throwable e) {