API asymmetry: TCP vs UDP, client vs server
hannesm opened this issue · 1 comments
hannesm commented
The current API is a composition of TCP:
- Mirage_protocols.TCP: dst, create_connection, write_nodelay
- Mirage_flow.S (read/write/close)
- Mirage_stack: listen_tcp
UDP:
- Mirage_protocols.UDP: write
- Mirage_stack: listen_udp
Also, TCP and UDP differs: TCP has a "dst" function for a "flow" to retrieve the peer address and port. UDP embeds that information in the callback.
This means a variety of opam packages and modules / functors are needed to understand how to setup a client and server -- and it is rather asymmetric for client & server, but also for TCP & UDP.
It would be great if that could be unified.
hannesm commented
since there doesn't seem to be much interest, I'm closing this. If there's interest, maybe a PR is more useful than an issue.