3 ms·
I'm like 3 sentences in and already things do not quite make sense. > Calling [socket] operations in the wrong order [...] is undefined behaviour in C. UB? Fo
by 12_throw_away 7mo ago
I'm like 3 sentences in and already things do not quite make sense.
> Calling [socket] operations in the wrong order [...] is undefined behaviour in C.
UB? For using a socket incorrectly? You sure about that?
> Documentation — trust the programmer to read the man page (C, Rust).
I'm sorry, are they saying that rust's socket interface is unsound? Looks to me like it's a pretty standard Rust-style safe interface [1], what am I missing?
[1] https://doc.rust-lang.org/std/net/struct.TcpListener.html https://doc.rust-lang.org/std/net/struct.TcpListener.html
- WhyNotHugo 7mo agoThey say “undefined behaviour”. They mean “returns an error”, or “can return an error”.
- tom_ 7mo agoThe C standard doesn't have anything to say about sockets at all, so not like it's defined to use them even in the right order.