Problem of hundreds ChannelHandler for one connection

magiceye magiceye at 163.com
Thu May 12 02:11:52 EDT 2011


Indeed I'm misunderstand the 'event' in netty. ChannelEvent used to describe
general concept event in communication. The minimal granularity is 'message
arrived', it is impossible to do more such as 'what the message type is
which I defined'. 

But there is a sentence copy from netty user guide in section 2.3 :
"Well-defined and extensible event model is a must for an event-driven
application. Netty does have a well defined event model focused on I/O. It
also allows you to implement your own event type without breaking the
existing code at all because each event type is distinguished from each
other by strict type hierarchy. This is another differentiator against other
frameworks. Many NIO frameworks have no or very limited notion of event
model; they often break the existing code when you try to add a new custom
event type, or just do not allow extension."

what the meaning of 'your own event type'? It seems netty can support
user-define message event dispatcher. But how? Derive from 'MessageEvent' to
make myself message event such as "AttackEvent"? But messageReceived's
parameter type is MessageEvent, no way to dispatch those 'new event type'

--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Problem-of-hundreds-ChannelHandler-for-one-connection-tp6343673p6354614.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list