About the command handling of MSN protocol
khc at pidgin.im
Tue Jun 23 18:18:33 EDT 2009
On Tue, Jun 23, 2009 at 09:53:48PM +0800, Peng Jing wrote:
> Thanks for your reply.
> Did you mean this:
> we do all the things in a single thread:
> 1. Invoke select() or use some similar methods to read the data coming from the socket when there is any.
> 2. If we read data successfully, parse the data received(Maybe we need to tokenize the commands and enqueue them).
> 3. If there are unhandled commands in the queue, pick one from the head of queue, call the corresponding functions to handle it.
If you always process the commands right away, then there will never be
any unhandled command other than the current one.
More information about the Support