The IP address on which the server actually listens needs to be passed to the Sonos device so that the Sonos device can call back when an event is triggered.  So we need to know the IP address as seen by the Sonos devices.  Using 0.0.0.0 here therefore won't work, because that cannot be used by the Sonos device to call the server back.

This should work fine if there are multiple NICs though I haven't tested it.  The method used should look up the correct route, and therefore make sure that the server listens on the correct IP address.

I suppose we could make the IP address configurable, but I'm not sure what the use case for this would be since there is always (?) one and only one correct IP address to use here, and this method determines it automatically.