get the default broadcast network address.

This commit is contained in:
2026-08-03 15:44:21 +02:00
parent cffedd6dbf
commit 1f9208560f
6 changed files with 71 additions and 11 deletions
+12 -1
View File
@@ -13,6 +13,14 @@ interface.
@section{Discovering devices}
@defproc[(upnp-default-ipv4-address) string?]{
Returns the local IPv4 address selected by the operating system for traffic to
the SSDP multicast destination @tt{239.255.255.250:1900}. No datagram is sent.
This is normally the interface through which UPnP devices on the local network
can be reached.
}
@defproc[(query-upnp-devices
[kinds (or/c 'all symbol? (listof symbol?)) 'all]
[#:interface interface (or/c #f string?) #f]
@@ -26,7 +34,10 @@ Discovers and describes matching UPnP devices.
@racket['all] returns all described devices. A symbol such as
@racket['media-renderer] selects one known kind, and a list selects several
kinds. When @racket[interface] is a local IPv4 address, SSDP multicast is sent
through that interface. Reverse DNS lookup is only attempted when @racket[dns?] is true.
through that interface. When it is @racket[#f],
@racket[upnp-default-ipv4-address] is used automatically. If automatic
detection fails, discovery falls back to the interface selected by the
operating system. Reverse DNS lookup is only attempted when @racket[dns?] is true.
@racket[mx] is the SSDP response delay advertised in the M-SEARCH request.
The default receive window is @racket[mx] plus one second. An explicit