Hello.
I've been busy improving the network code. I've made quite a few
changes in order to change the previous inefficient way of receiving
messages. Changes involve:
- New class MsnBuffer, to cache everything received from the servers.
From it, its possible to obtain the msn command or message that has not
been processed, a FIFO for commands and messages.
- Other changes in the way messages are process to incorporate the new
class.
- Now the messages' arguments are split via a new contructor in the
StringTokenizer class.
- To simplify access to these arguments I created another class to
access the token list, StringList, this class saves us the constant
casting of BString pointers, also has the [] operator to access the
strings and a static method to delete all strings in a list.
- Added a destructor to StringTokenizer to delete its list object (just
the object, not its contents).
- Changed getTokens() to return a copy of the list, since the new
destructor will delete the list object.
Tim, the only class affected by the changes in StringTokenizer is
IconLoader, and is only in the (BString*) casting, so I took the
liberty of making the changes, I hope you don't mind.
So far works fine, but needs more intensive testing. This should be in
the CVS by the time you read this, the code for MsnBuffer is in the
MsnServerHandler.cpp/h files.
Let me know what you think.
Regards,
Daniel
|