Can I send the same ChannelBuffer to different clients concurrently?

redstrato kkygang at gmail.com
Wed Jan 5 23:21:28 EST 2011


Hi,

I think you can use ChannelGroup but actually this will also duplicate your
ChannelBuffer internally to avoid a race condition.

http://docs.jboss.org/netty/3.2/api/org/jboss/netty/channel/group/ChannelGroup.html#write(java.lang.Object)

if you want to use only one ChannelBuffer for all Channels, you should
synchronize your ChannelBuffer for each Channel and this can cause
performance issues.

--
redstrato



basketboy wrote:
> 
> Hi,
> 
> I need to send the same message to every client that connects to the
> server. To avoid the overhead of creating a new ChannelBuffer every
> time, I tend to create a static one and send it to users. Is it going
> to cause any problem in performance/correctness? Thanks in advance.
> 
> -- 
> Timmy
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
> 
> 

-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Can-I-send-the-same-ChannelBuffer-to-different-clients-concurrently-tp5892424p5894547.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list