4 ms·
UDP is a spec. TCP is a spec. HTTP 1..3 is a spec. There are only a few ways to implement it.
by zelly 7y ago
UDP is a spec. TCP is a spec. HTTP 1..3 is a spec. There are only a few ways to implement it.
- nicoburns 7y agoRust already has synchronous TCP and UDP in the standard library (https://doc.rust-lang.org/std/net/index.html https://doc.rust-lang.org/std/net/index.html). But most people want to use async versions, at which point there very much isn't one way to implement it. Once you get to higher level protocols like HTTP, you also have questions like "should HTTP header be strings or encoded as types. There very much isn't just one way to implement it.
- bsder 7y agoDo you do it with callbacks or polling? That's pretty fundamental and completely changes your API. And, before you reply, you might want to know that while the majority of things do it with callbacks, both the lowest embedded AND highest custom networking systems implement networking with polling (for different reasons).