I have Client/Server System (using Socket) with multiple clients and single server, which is sending xml datas every seconds on all clients.
The XML datas are always in different size between 1 – 18000 characters and server needs to send these XML-Datas to all clients at the same time.
Now I want to know, how to make the communication between the server and clients faster.
Maybe I will ask more then one Question, but I am really stucked at this point and I can’t continue anymore.
- Should I compress every XML-Data before sending?
- Should I serialize the XML-Datas? (maybe the xml data size will be decreased)
- Do I need to convert every XML-Datas into byte[] array(for buffer),
because the communication must be done at the sametime for all clients.
Thank You!
You could use a middle layer with built in pub-sub topology if you are currently iterating through your connected clients. 0MQ has the ability for a single publisher to send to n subscribers very efficiently and has a C# binding. You could also compress the messages before being sent as you suggested.