pupnp / pupnp

libupnp: Build UPnP-compliant control points, devices, and bridges on several operating systems.
https://pupnp.github.io/pupnp
BSD 3-Clause "New" or "Revised" License
349 stars 114 forks source link

How to Know the Source Port for gSsdpReqSocket? #410

Open mwswartwout opened 1 year ago

mwswartwout commented 1 year ago

As far as I can tell, gSsdpReqSocket(4|6) is not bound when SearchByTarget is called, so the source port is random. Is the SDK ever aware of what port is chosen, and is there a way that client code can reference this port number?

Alternatively, is there a way to bind gSsdpRequestSocket in advance so that we can know the source port for future searches?