日期:2014-05-18 浏览次数:20656 次
Quote: 引用: public static void pushToClient(ChannelBuffer buf){ try{ synchronized(channelList){ for(Channel chn:getChannelList()){ if(chn.isWritable()) { chn.write(buf); } } } }catch(Exception e){ } }您的意思是进入public void channelActive(final ChannelHandlerContext ctx)后,把ctx.channel()放进channelList吗?
public static void pushToClient(ChannelBuffer buf){ try{ synchronized(channelList){ for(Channel chn:getChannelList()){ if(chn.isWritable()) { chn.write(buf); } } } }catch(Exception e){ } }