Because connections run in their own thread, access to the message queue object has to be synchronised. Using a mutex to lock the entire queue for the duration of the queue/dequeue operation is inefficient as there is nothing wrong with a consumer thread removing a message from the front of the queue at the same time as a producer thread is adding a message to the rear. Therefore, the MessageQueue class was implemented using a semaphore[Bac97] to protect an STL queue data structure.
Although the original plan had the client maintaining a session with the server by ``logging in'' it was realised that this was unnecessary if every message was signed. Therefore, the <authenticate> message merely identifies the user to the server and the server sends back their <UserInfo> details. Although it is trivial for a client to lie to the server about their identity, if all the information stored on the server is public and they cannot update any information without a signature, there is nothing Charlie can gain by impersonating another user to the server. The one problem this does cause is that a server cannot automatically change their status to ``Offline'' when they logoff. This is not ordinarily a problem, the user (or their client) just has to be responsible for sending the ``Offline'' message themselves, but it might be quite irritating for users on a dialup connection which dies unexpectedly, so some form of solution to this problem should be found for future versions of the system.