List of usage examples for io.netty.channel.group ChannelGroup writeAndFlush
ChannelGroupFuture writeAndFlush(Object message);
From source file:com.github.mrstampy.gameboot.netty.NettyConnectionRegistry.java
License:Open Source License
/** * Send the message to a specific group. * * @param groupName/*from w ww .ja v a 2s . co m*/ * the group key * @param message * the message * @param listeners * the listeners */ public void sendToGroup(String groupName, String message, ChannelFutureListener... listeners) { groupCheck(groupName); if (!groups.containsKey(groupName)) { log.warn("No group {} to send message {}", groupName, message); return; } ChannelGroup group = groups.get(groupName); ChannelFutureListener[] all = utils.prependArray(f -> log((ChannelGroupFuture) f, groupName), listeners); ChannelGroupFuture cf = group.writeAndFlush(message); cf.addListeners(all); }
From source file:com.github.mrstampy.gameboot.netty.NettyConnectionRegistry.java
License:Open Source License
/** * Send the message to a specific group. * * @param groupName/*from w ww . j a v a 2 s . c om*/ * the group key * @param message * the message * @param listeners * the listeners */ public void sendToGroup(String groupName, byte[] message, ChannelFutureListener... listeners) { groupCheck(groupName); if (!groups.containsKey(groupName)) { log.warn("No group {} to send message {}", groupName, message); return; } ChannelGroup group = groups.get(groupName); ChannelFutureListener[] all = utils.prependArray(f -> log((ChannelGroupFuture) f, groupName), listeners); ChannelGroupFuture cf = group.writeAndFlush(message); cf.addListeners(all); }