Forum Discussion

eswarbala's avatar
eswarbala
Visitor
14 years ago

Multicast problem

I wrote a simple program to send a UDP datagram to a multicast address , but the packet never shows up in wireshark traces both at the receiver end and Roku end.

I tried just modifying the socket_test example (UDP client) to send to a multicast address ex:224.0.0.1 and still dont see the packet.

All I am doing is
* create roDatagramSocket
* create socketaddress with address set to a multicast ip and a port (ex:224.0.0.1:1000)
* call setSendToAddress on the socket and
* call sendStr on the socket. - sendstr returns > 0 signifying success
* I don't see this packet out of Roku in network traces.

Am I missing anything?

Any help is appreciated

thanks

3 Replies

  • Here is my configuration if it makes a difference:
    Roku (not Gen 2) running Software v3.1
    Using 4.1 SDK
  • OK. I figured out the issue.

    If you dont set the hostname on the socket or set the roSocketAddress' hostname (roSocketAddress.setHostname) to 0.0.0.0 it does not work. You have to explicitly set the hostname to ip address of roku and then multicast works fine.
  • My tests don't require setting the local address of the socket. The following code works for me:

    port = CreateObject("roMessagePort")

    ssdpAddress = "239.255.255.250"
    ssdpPort = 1900

    groupAddr = CreateObject("roSocketAddress")
    groupAddr.setAddress(ssdpAddress)
    groupAddr.setPort(ssdpPort)

    search = CreateObject("roDatagramSocket")
    search.setSendToAddress(groupAddr)
    search.setMulticastTTL(1)
    search.setMessagePort(port)
    search.notifyReadable(true)

    search.sendStr("MSEARCH ...")

    ...
    msg = wait(<timeout>, port)
    ...