What are the differences in functionality and performance between AF_UNIX and AF_INET in socket communications within a Linux system?

Asked 2 years ago, Updated 2 years ago, 46 views

When using sockets for inter-process communication running on the same machine, AF_UNIX and AF_INET often use AF_INET for inter-process communication in the system, as they believe there is no significant difference in functionality or performance.
 I haven't had any trouble so far, but I'd like to ask you a question if there's a problematic difference.

linux

2022-09-30 19:38

1 Answers

AF_INET is identified by the IPv4+ port number.Therefore, IPv4 is required for the contact.AF_UNIX is identified by filename.Therefore, the communication partner is a process that runs on the same machine.(e.g. X server and X client)
Both are completely different.


2022-09-30 19:38

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.