Suppose there is a server that has 2 main methods: return the value of a variable and update its value. And there is a client who sends a request and receives either a value or a notification that the data is received. How to organize this? What to transmit over the network? Plain text? Serialized objects with server instructions?

PS.: The best answer is a link to some article or manual ...

  • one
    For the described task, anything will do. If there are requirements for performance, security, etc., then you need to look separately. - a_gura
  • @avp, can you make this comment as an answer? - sinedsem

2 answers 2

@Dazar , the simpler the protocol, the better. In your case (in fact, you did not fully specify your task), apparently the easiest is to exchange strings with text.

Associate a tcp socket with an I / O stream and drive strings. Each team and the relevant data. Completely similar to I / O from the terminal.

-

IMHO it is so obvious that it is unlikely that anyone would write special manuals (and articles).

    The only thing I will add to avp is just in case, use special characters to separate the lines (messages) among themselves.