Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDP override #4

Merged
merged 3 commits into from Jan 29, 2024
Merged

UDP override #4

merged 3 commits into from Jan 29, 2024

Conversation

rylev
Copy link
Owner

@rylev rylev commented Jan 19, 2024

This PR moves UDP to a similar architecture to how TCP works after #2.

The UdpSocket trait sets out all of the overrideable features for UDP including the ability to generate outgoing and incoming streams which themselves can be overwritten with custom logic.

The OutgoingStream and IncomingStream traits might need further adjustment. Currently they both require implementors to implement a ready function for when the streams can be written to/read from. Perhaps it's possible to refactor this such that only one function is needed that can both signal readiness and allow for the actual writing/reading, but my attempt to come up with a design for that came up short.

Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
@rylev rylev marked this pull request as ready for review January 22, 2024 17:47
@badeend
Copy link

badeend commented Jan 24, 2024

This looks good to me!

For a future iteration:
I've created a PR to wasmtime to get mutable access to the WasiView in the Pollable (Subscribe) method. If/when that lands, we can do away with the separate Incoming/OutgoingStream traits, and have just a single UdpSocket trait with mutable methods.

@rylev rylev merged commit 109efa1 into lookup-override Jan 29, 2024
@rylev rylev deleted the udp-override branch January 29, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants