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

unlisten of a port #452

Closed
hannesm opened this issue Jul 19, 2021 · 0 comments · Fixed by #457 or ocaml/opam-repository#19981
Closed

unlisten of a port #452

hannesm opened this issue Jul 19, 2021 · 0 comments · Fixed by #457 or ocaml/opam-repository#19981

Comments

@hannesm
Copy link
Member

hannesm commented Jul 19, 2021

A listen (_tcp / _udp) function exists, but there's no way to not listen to that port anymore. Now, in some use cases (e.g. a DNS resolver), all that is needed is "send packet from port P to Y:P'" and "wait for an answer to port P (from Y:P')", but once the answer is received, the listening socket on port P can be safely closed.

Also note that the current semantics of calliing listen mutliple times with the same port on the same stack diverges between socket and direct stack -- the socket stack will fail (ADDRINUSE), the direct stack will overwrite the listener.

hannesm added a commit to hannesm/opam-repository that referenced this issue Nov 11, 2021
CHANGES:

* Adapt to mirage-protocols 6.0.0 API (mirage/mirage-tcpip#457 @hannesm)
* TCP and UDP now have a listen and unlisten function (fixes mirage/mirage-tcpip#452)
* type ipinput (in TCP and UDP) and listener (in TCP) have been removed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant