binary protocols v. text protocols

后端 未结 8 1749
慢半拍i
慢半拍i 2020-12-12 09:27

does anyone have a good definition for what a binary protocol is? and what is a text protocol actually? how do these compare to each other in terms of bits sent on the wire?

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-12 09:58

    I think you got it wrong. It's not the protocol that determines how data looks on the "wire", but it's the data type that determine which protocol to use to transmit it. Take tcp socket for instance, a jpeg file will be sent and received with a binary protocol 'cause it's binary data (not human readable, bytes that go among the 32-126 ascii range), but you can send / recv a text file with both protocols and you wouldn't notice the difference.

提交回复
热议问题