Why use local channels instead of sockets to exchange programs within the same computer?

Why use local channels instead of sockets to exchange programs within the same computer? Is there any single FRESH statistic regarding who is faster and like nmuch, which has more secrets or less?

I found the cautious old and strange and scary ... http://home.iae.nl/users/mhx/pipes&socks.html

There is a noticeable difference in performance between sockets and named pipes. Benchmark 1: 20 Mbytes copied between two iForths on machine 1; Benchmark 2: 20 Mbytes copied from an iForth on machine 2 to an iForth on machine 1. Systems for sock test: Windows XP Pro, running on (1) an Intel PIV 3GHz/1GB and (2) an Intel Core 2 Duo 2.66 GHz/2GB. The PC were networked using motherboard Realtek network adapters (100 Mbit/s). Systems for npipe test: Windows NT 4.0, running on (1) an Intel Pentium 166MHz/48MB and (2) an Intel Pentium 200MHz/48MB. The PC were networked using cheap NE2000 clones (10 Mbit/s). benchmark | process A read | process B write ===========+================+================ sock bm 1 | 72 MB/sec | 732 MB/sec sock bm 2 | 11.5 MB/sec | 2.857 GB/sec npipe bm 1 | 15 MB/sec | 15 MB/sec npipe bm 2 | 715 KB/sec | 715 KB/sec 

And there is some strange information here (at least for me - a Windows user)

+4
source share
1 answer

Pipes should always be faster because they completely bypass the network stack in the host operating system. Pipes are considered safer because they do not listen to data from untrusted remote computers (although sockets can also be configured to only listen on the feedback adapter and thus not listen to remote computers). Named pipes are less flexible than sockets because they do not allow network communication. In any case, security is still related to how well you write code. You can write a pipe-based application that is less secure than a socket-based application.

How faster than another, which will depend on your hardware and operating system.

+6
source

Source: https://habr.com/ru/post/1312985/


All Articles