oatpp / oatpp-ssdp

Oat++ extension module to work with SSDP protocol.
https://oatpp.io/
Apache License 2.0
2 stars 2 forks source link

Is it possible to support SSDP Discovery Advertisement with this module? #7

Open EDDragonWolf opened 2 years ago

EDDragonWolf commented 2 years ago

Hi @lganzzzo,

I came to another issue for which I would like to know your opinion.

According to the specification, the device should support notify message called Discovery Advertisement and send it to 239.255.255.250:1900 when it appears in the network, periodically during its lifetime, since each advertisement has an expiration time, and before it becomes unavailable (for example, when you turn off the device).

I have searched how to implement at least a single notification message at the start and end of the device lifetime but didn't find any clear way in the Oat++. From my point of view, I need to define the ApiClient that should be able to send these notification messages via the UDP stream. Unfortunately, current SimpleSsdpUdpStreamProvider is a ServerConnectionProvider, so it's impossible to use it with ApiClient and RequestExecutor. Additionally, I probably cannot use another UDP socket for it since SimpleSsdpUdpStreamProvider is already bound to the same IP and port.

So I wonder, is there any way how I can send these notification messages using the already existing SSDP server? Or how to create a ClientConnectionProvider that will be able to use the same socket to write a message to it? Or maybe you have a better way to do it.

Thank you.

lganzzzo commented 2 years ago

Hey @bamkrs , do you have any ideas or suggestions?