"It's hard to understand" agreement

Before understanding has been unclear, protocols, and sequence of the relationship, now my mind sober point, the next record now think.
Text and binary protocols: e.g. the redis set ax, is the use of text-based protocol, with a space for line breaks, etc., for easy viewing, of course, also during the transmission of binary byte transfer. Http protocol, for example, a space is defined as a separator and the like.
And there is no agreement among the binary characters such as spaces, when byte converted to text, you can not get the right content, you need to define the length in bytes of the head, or the two sides agreed definition of length.

What is serialized, in accordance with java say, it is to convert an object into a byte behavior. Such as a sequence of bytes is to convert text to act http request.
What we often say json that? json You can be understood as a serialization, to convert the object into json java string converted to byte. You can also be understood as a protocol, using a comma as a delimiter, and data acquisition. For example according to the http way, you can define {path: / x / y} need to be accessed as the path, instead of the http in the url. So in my understanding, each of the data exchange format, can be used as a protocol. is hessian, a serialization may be used as a protocol.

Reproduced in: https: //juejin.im/post/5d07a606f265da1bb77669b7

Guess you like

Origin blog.csdn.net/weixin_34261739/article/details/93179263