I've working on a chat type project at the moment. I was originally using a DB but decided to move to XML which has improved speed a lot and also made the control more portable. I have two related issues that I was hoping you guys could pass comment on.
The first is dealing with multiple users either reading or trying to write to the xml file when someone else already has it open. I've had to be an Exception loop around the write process to 'queue' the writes from different users. This means that sometimes there is now an issue with speed of response.
The second issue is to do with the speed at which my code read and writes xml. Speeding it up would help my app generally and but would also help with issue one.
Here is my code. Just so you are aware, when someone makes a post it does Savemessage and then Getmessages. Getmessages also runs every 3 seconds regardless:
public List<Chat.Message> Getmessages(int numberOfMessages, int lastMsgID)
List<Chat.Message> res = new List<Chat.Message>();
DataSet xmlDB = new DataSet("xmlMSG");
if (xmlDB.Tables.Count > 0)
// I only want a maximum of the last
View Complete Post