private void sendOthers(String string){
for(MyChannel temp: all){
if(temp.equals(this)){
continue;
}
temp.send(string);
}
}
导致只有部分客户端可以收到信息
新手错误:在遍历数组列表时,在该使用continue的时候错用break,导致方法直接结束
最新推荐文章于 2022-09-30 19:10:41 发布
private void sendOthers(String string){
for(MyChannel temp: all){
if(temp.equals(this)){
continue;
}
temp.send(string);
}
}
导致只有部分客户端可以收到信息