IPC performance: Named Pipe vs Socket

后端 未结 10 1571
自闭症患者
自闭症患者 2020-11-28 01:39

Everyone seems to say named pipes are faster than sockets IPC. How much faster are they? I would prefer to use sockets because they can do two-way communication and are very

10条回答
  •  半阙折子戏
    2020-11-28 02:12

    I would suggest you take the easy path first, carefully isolating the IPC mechanism so that you can change from socket to pipe, but I would definitely go with socket first. You should be sure IPC performance is a problem before preemptively optimizing.

    And if you get in trouble because of IPC speed, I think you should consider switching to shared memory rather than going to pipe.

    If you want to do some transfer speed testing, you should try socat, which is a very versatile program that allows you to create almost any kind of tunnel.

提交回复
热议问题