c# - Unified communication -


i wondering how should set interprocess unified communication in better way now. client process sends lot of messages of different sort server process. messages like... have done work[what],i started @ [time], ended at[time]. or state, progress command messages.

example message: from:process1;startedat|12:12:12;endedat|12:45:56;doneunit:51

server parser split string semicolon. first part reads message sent. second , third part reads times , last how work did. when add info @ end of message

ex. from:process1;startedat|12:12:12;endedat|12:45:56;doneunit:51;source:tablet have rewrite server parser well.

server tries parse received message using own parse function. every message has own format. parser know how should message look. if change format on client have change on server well. not seems efficient way.

for reason ask question. how should communication better or there different approach how store format client , server on 1 place?

i use c# .net 3.5(must version)

thank reply

the obvious solution problem not write parsing code yourself.

if create class can serialized, can send serialized version of class on wire , deserialize @ other end. means message class can shared between both applications, , parsing code trivial. depending on requirements, can use various serializers: xml or json verbose human-readable, or binary serializer more efficient in terms of bandwidth (but harder debug or monitor over-the-wire).


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -