My own corner of monopam
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

ocaml-mdns: defer README discovery via let run ()

[let () = Eio_main.run ...] caused mdx execution to actually send mDNS
queries over the network, which fails [Unix_error (No route to host)]
in non-multicast environments. Wrap as [let run () = ...] (per the
mdx skill: defer Eio mainloop / network / disk), switch
[Format.printf] to [Fmt.pr], and add [eio.core] / [domain-name] /
[fmt] to the mdx libraries.

+4 -5
+3 -4
ocaml-mdns/README.md
··· 38 38 ## Usage 39 39 40 40 ```ocaml 41 - (* Discover HTTP services on the local network *) 42 - let () = 41 + (* Discover HTTP services on the local network. *) 42 + let run () = 43 43 Eio_main.run @@ fun env -> 44 44 Eio.Switch.run @@ fun sw -> 45 45 let name = Domain_name.of_string_exn "_http._tcp.local" in ··· 51 51 in 52 52 let merged = Mdns.merge responses in 53 53 List.iter 54 - (fun (_, instance) -> 55 - Format.printf "Found: %a@." Domain_name.pp instance) 54 + (fun (_, instance) -> Fmt.pr "Found: %a@." Domain_name.pp instance) 56 55 merged.Mdns.ptrs 57 56 ``` 58 57
+1 -1
ocaml-mdns/dune
··· 4 4 5 5 (mdx 6 6 (files README.md) 7 - (libraries mdns eio_main eio eio.unix)) 7 + (libraries mdns eio_main eio eio.core eio.unix domain-name fmt))