Remix.run Logo
stingraycharles 6 hours ago

So UdpSocket should really be called DatagramSocket, UDP being the protocol that operates on these datagrams?

Surprising that they got such a fundamental thing wrong.

krater23 5 hours ago | parent [-]

That happens when someones learning project ("I rewrite a library in the new language I want to learn") ends up in productive code.

IshKebab 5 hours ago | parent [-]

This is in the standard library; it's not a learning project. And it also isn't even incorrect - see erk__'s comment.

Rust is an excellent language and fully capable of production use.

Sharlin 3 hours ago | parent [-]

It's not, it's the `socket2` library. The standard sockets don't allow (ab)using actual `UdpSocket`s as a different kind of datagram socket.

IshKebab an hour ago | parent [-]

We're talking about UdpSocket: https://doc.rust-lang.org/stable/std/net/struct.UdpSocket.ht...

Sharlin 43 minutes ago | parent [-]

Yes, I know, but the point is that the standard UdpSocket is correctly named as it doesn’t represent any other datagram socket. Uh, we’re pribably in agreement here actually.

IshKebab 19 minutes ago | parent [-]

Yeah exactly! :-D