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

Instead of using Lwt.async + Lwt_mvar when receiving UDP datagram, use an Lwt_stream.t #4

Open
rand00 opened this issue Mar 8, 2023 · 8 comments · May be fixed by #10
Open

Instead of using Lwt.async + Lwt_mvar when receiving UDP datagram, use an Lwt_stream.t #4

rand00 opened this issue Mar 8, 2023 · 8 comments · May be fixed by #10
Labels
good first issue Good for newcomers

Comments

@rand00
Copy link
Owner

rand00 commented Mar 8, 2023

This line is currently made async, to avoid the S.UDP.listen callback to block when the conntest protocol is slower than UDP datagrams can be received. If an Lwt_stream was used instead of an Lwt_mvar, there would be no need for this.

As the protocol has an acknowledge mechanism (done each n packets), this stream will be guaranteed not to grow in size indefinately. This just allows the conntest protocol to run a bit out of sync from when UDP datagrams are received.

Switch out these types for the sink field in the Udp_flow.t type

@rand00 rand00 added the good first issue Good for newcomers label Mar 8, 2023
@prernadabi23
Copy link

Hello @rand00, I am an Outreachy applicant. I would Like to work on this issue.

@rand00
Copy link
Owner Author

rand00 commented Mar 9, 2023

Hi @prernadabi23 - welcome to the project, that would be great (:
Feel free to ask any questions on this issue

@prernadabi23
Copy link

Thank you @rand00,
So, how do I proceed with the issue?
Do I just have to replace " Lwt_stream" in place of "Lwt_mvar"?

@rand00
Copy link
Owner Author

rand00 commented Mar 9, 2023

Have you already tried to compile conntest?

So it's a couple of changes, but the primary one is indeed what you said. If you start to change this type of the sink field, the compiler will help you to see where you need to change things in other places

@rand00
Copy link
Owner Author

rand00 commented Mar 9, 2023

Btw. when you want to iterate quickly on compiling a MirageOS unikernel, it's useful not to run mirage configure and make depend (takes a lot of time), but only:

mirage build -f mirage/config.ml

@prernadabi23
Copy link

Is it possible to compile it in Windows or will I have to use Ubuntu/Linux?

@rand00
Copy link
Owner Author

rand00 commented Mar 9, 2023

We've had some discussion these days about how to do it on Windows, as many Outreachy applicants use that. I think the easiest solution will be if you install Ubuntu via Windows Subsystem for Linux (WSL). There is a guide here

@rand00
Copy link
Owner Author

rand00 commented Mar 9, 2023

As you havn't installed ocaml yet - forgot to mention that we have this Outreachy MirageOS introduction: mirage/mirage#1402

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
2 participants