The title of the topic seems scary, but I think it touched upon an important question.
I worked on a project in Rust that needs network programming. I found that Rust has multiple options for socket programming, but each with its own problems (in my view):
-
std::net
- does not support low-level socket APIs, for example setsocketopt
.
- crate
socket2
- does not have related APIs, for example get all local interface IP addresses.
- crate
nix
- does not provide a Rust socket
abstraction, using RawFd
instead.
And because there are 3 of them, the mixing of their definitions (symbol names) also cause confusions.
(There is also separate async socket implementation I didn't get into).
I asked the above question sometime ago on Reddit and eventually went with using crate nix
only. But I was wondering, what's the plan for the std::net? Any plan to merge socket2
or some of nix
into it, or something else?