eswarbala
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2012
10:05 PM
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
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 3
eswarbala
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2012
10:28 AM
Re: Multicast problem
Here is my configuration if it makes a difference:
Roku (not Gen 2) running Software v3.1
Using 4.1 SDK
Roku (not Gen 2) running Software v3.1
Using 4.1 SDK
eswarbala
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2012
07:32 PM
Re: Multicast problem
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.
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.
RokuMEmerson
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2012
01:32 PM
Re: Multicast problem
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)
...
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)
...