Skip to content

Allow specifying a fixed port for the ssdp requests

john obaterspok requested to merge (removed):master into master

Using gupnp it's possible to setup a fixed port to listen on. Below is output from netstat where the fixed port is 40_000

gupnp

tcp 9 0 192.168.0.104:40000 0.0.0.0:* LISTEN

udp 0 0 192.168.0.104:40000 0.0.0.0:*
udp 0 0 192.168.0.104:1900 0.0.0.0:*
udp 0 0 239.255.255.250:1900 0.0.0.0:*

npupnp

Doing the same with npupnp using UpnpInitWithOptions("*", 40 * 1000, UPNP_FLAG_IPV6, UPNP_OPTION_END) gets us this

tcp6 0 0 :::40000 :::* LISTEN

udp 0 0 0.0.0.0:34270 0.0.0.0:*

udp6 0 0 :::44309 :::*

udp 0 0 0.0.0.0:1900 0.0.0.0:*

udp6 0 0 :::1900 :::*

udp 0 0 127.0.0.1:35916 0.0.0.0:* (MiniServer stop socket)

patched npupnp

The attached patched changes the SSDP requests to use an optional port or the same 49152 port for both tcp + udp:

tcp6 0 0 :::40000 :::* LISTEN

udp 0 0 0.0.0.0:40000 0.0.0.0:*

udp6 0 0 :::40000 :::*

udp 0 0 0.0.0.0:1900 0.0.0.0:*

udp6 0 0 :::1900 :::*

udp 0 0 127.0.0.1:33541 0.0.0.0:* (MiniServer stop socket)

Edited by john obaterspok

Merge request reports