PDA

Click to See Complete Forum and Search --> : Message Style application, need advice.


hellswraith
Feb 1st, 2004, 03:30 PM
Ok, I have to implement a system that is basically a messaging system. A admin will send a message, and the server is responsible for distributing out that message to sometimes over a thousand people at one time. That server must also get messages back from the client apps so it can time stamp responses, etc. The communications is going to be pretty simple messages, nothing like file transfers or anthing.

What I have started with has been a async socket example I have found on the net. I understand it well, but timing the sending of 1000 messages, and receiving 1000+ responses within 1 second is scaring me a little. I get 991 responses back right off the bat, and get 9 errors. This is pretty good. If I add in some error handling in the client side and enter a for loop to keep trying to send the response, I am getting all responses back.

Ok, this is all good at this point, but now here comes the kicker, I am going to have to save these messages in the database. I can solve all these problems with things like threading...

My question is, am I missing a simpler architecture? Should I look at something else before I go to far?

Magiaus
Feb 5th, 2004, 01:22 PM
I think your an the right track. The only other thing I might consider was if it would be faster to write the messages to a log file and then have a batch job migrate the log to the database at 2:00 AM every morning or something. I honestly don't know how much faster straight flat file i/o would be.

hellswraith
Feb 5th, 2004, 10:32 PM
I have looked at that myself. I kind of wanted to turn the whole scheme of the thing to xml file based storage since the data requirements are not very strong, but the client wants sql server.

I was looking at maybe UDP, Multicasting, etc. I have never used networking technologies such as sockets and the ones previously mentioned, so I don't know if I am on the right track, let alone what I am talking about...lol. I learned sockets, which is terribly easy, but I just didn't have the time to research all options that may be available. I was just looking for some quick advice on which way I should head if I was going in the wrong direction. It seems that sockets are working out, and it is pretty much too late at this point to change how things are done.

Magiaus
Feb 6th, 2004, 11:26 AM
I used UDP years ago to play with making a Instant Messanger I didn't like it I ended up using sockets(WinSock TCP actualy) It's been so long ago I don't remember why I didn't use UDP except it seemed the weaker of the techs.

I stopped to dig through my books and read about UDP I didn't use it because I wanted to be sure of the connection and I didn't want to broadcast information out that anyone could get a hold of with enough effort. It also says UCP isn't good for passing any large amount of data and TCP should be used. You probably using you best option already.