Socket Protocol Fundamentals

后端 未结 5 963
温柔的废话
温柔的废话 2020-12-16 18:37

Recently, while reading a Socket Programming HOWTO the following section jumped out at me:

But if you plan to reuse your socket for further transfers,

5条回答
  •  孤街浪徒
    2020-12-16 18:50

    The common protocols either specify length in the header, or are delimited (like HTTP, for instance).

    Keep in mind that this also depends on whether you use TCP or UDP sockets. Since TCP sockets are reliable you can be sure that you get everything you shoved into them. With UDP the story is different and more complex.

提交回复
热议问题