How slow are TCP sockets compared to named pipes on Windows for localhost IPC?

后端 未结 6 879
广开言路
广开言路 2020-12-02 11:33

I am developing a TCP Proxy to be put in front of a TCP service that should handle between 500 and 1000 active connections from the wild Internet.

The proxy is runn

6条回答
  •  再見小時候
    2020-12-02 12:03

    It will be the same (or at least not measurably different). Winsock is smart enough to know if it's talking to a socket on the same host and, in that case, it will short-circuit pretty much everything below IP and copy data directly buffer-to-buffer. In terms of named pipes vs. sockets, if you need to potentially be able to communicate to different machines ever in the future, choose sockets. If you know for a fact that you'll never need to do that, pick whichever one your developers are most familiar or most comfortable with.

提交回复
热议问题