Remix.run Logo
12_throw_away 4 hours 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

tom_ 4 hours ago | parent | next [-]

The 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.

WhyNotHugo 4 hours ago | parent | prev [-]

They say “undefined behaviour”. They mean “returns an error”, or “can return an error”.