c# - Should I use XML or Binary to send data from server to client? -


I have two separate apps - one client (in C #), one server (C ++) They want to exchange data as "structs" and a minute of ~ 1 MB data is sent from the server to the client.

What's better - XML ​​or my own binary format?

With XML:

  • Translation will be slow to XML using XML using parsets, I believe?
  • Compact data size
  • No need for meta information like tags;
  • But the strokes can not be easily changed to include new strokes / new members in the strokes in the future;
  • No conversions are necessary for binary (straight) from the text (XML), so to get and "gather" is faster in a single stream)

Any hint? Am I not considering binary? Have a bit confused about what the approach is taking.

1 MB of data is very low per minute if you have a proper network connection.

There are other options between binary and XML - other human-readable text serialization formats, such as JSON.

When it comes to binary, is - for the problems of the variants - technologies (I am biased: I work for Google and I have it) clearly

If you are worried about performance, then you should measure it with backward and forward compatibility. I am pretty sure that phone can adequately parse 1 MB XML because there is no problem in this case ... basically you are concerned about: < Li> Code of Simplification

  • Interoperability
  • Display in CPU case
  • Network traffic
  • Previous / forward compatibility
  • < Li> Human readability of on-the-wire format [/ li]

    All this is a balanced task - but you are the one who decides how many Is the weight each of these factors.


    Comments

    Popular posts from this blog

    sql - dynamically varied number of conditions in the 'where' statement using LINQ -

    asp.net mvc - Dynamically Generated Ajax.BeginForm -

    Debug on symbian -