0
Beantwoord

Example of iRidium Server Custom UDP driver joining a multicast group

Martin Lang 7 jaar geleden in Server Solutions bijgewerkt door Aleksandr Romanov (CTO) 7 jaar geleden 6

hi,


can you please give us an example server project with a udp driver

joining the multicast group 239.255.255.250 on port 1900?


tried dozends of configs but couldn't get it to work.


thx!


best regards,

 martin lang

"Joining" is not the functionality of UDP, it is implemented in higher-level protocols.

SSDP already in UPNP  http://dev.iridiummobile.net/Drivers_API/en#.Subscribe

But if you want to go a long way:

var inUDP = IR.GetDevice("In_UDP");
var outUDP = IR.GetDevice("Out_UDP");
IR.AddListener(IR.EVENT_RECEIVE_DATA, inUDP, function(data)
{
   IR.Log("GLOBAL IN DATA (1900 port):" + data)
});
IR.AddListener(IR.EVENT_RECEIVE_DATA, outUDP, function(data)
{
   IR.Log("UNICAST DATA (12345 port):" + data)
});
      
function snd() {
   outUDP.Send(["M-SEARCH * HTTP/1.1\r\n"+
   "HOST: 239.255.255.250:1900\r\n"+
   "MAN: \"ssdp:discover\"\r\n"+
   "MX: 5\r\n"+
   "ST: ssdp:all\r\n"]);
}




Check network settings with https://github.com/coherence-project/UPnP-Inspector

Thx! Can you give me a short example of how to use SSDP with the Subscribe command?

What is "Subscribe command"? It is not part of SSDP protocol.


again: UPnP already realized in i3 Pro!

http://dev.iridiummobile.net/Drivers_API/en#.Subscribe (eventSubURL)

IR.GetDevice("Sonos").Subscribe("urn:schemas-upnp-org:service:AVTransport:1");

sample: http://support.iridiummobile.net/topics/12214-sonos-not-working-with-latest-sonos-firmware/#comment-77802

Martin, the implementation was a success?