What''re functions of router, handler,and some methods (process(),deliver(?

hey all friends.

I want to know what’'re functions of router, handler,and some methods (process(),deliver()), etc.

thank for your future help.

: )


Yundeng

Hey Yundeng,

Routers are just responsible for sending packets to the appropriate handler. Routers do not have any logic other than locating the correct handler. On the other hand, handlers are the one that will actually take care of the packet. For instance, IQRouter will locate the proper IQHandler that will handle an IQ packet sent to the server. IQHandler will execute the proper logic based on the type of IQ packet. I would recommend reading the class comments of IQRouter, IQHandler (and its subclasses), PresenceRouter, PresenceHandler and MessageRouter. Debugging the server will also help you understand it.

Regards,

– Gato