Is sending data via UDP sockets on the same machine reliable?

后端 未结 5 1882
旧巷少年郎
旧巷少年郎 2020-12-15 17:16

If i use UDP sockets for interprocess communication, can i expect that all send data is received by the other process in the same order?

I know this is not true for

5条回答
  •  心在旅途
    2020-12-15 18:18

    Loopback UDP is incredibly unreliable on many platforms, you can easily see 50%+ data loss. Various excuses have been given to the effect that there are far better transport mechanisms to use.

    There are many middleware stacks available these days to make IPC easier to use and cross platform. Have a look at something like ZeroMQ or 29 West's LBM which use the same API for intra-process, inter-process (IPC), and network communications.

提交回复
热议问题