UDP Datagrams to Broadcast Address
Posted: Wed Jun 22, 2011 7:21 pm
Hi,
I'm having trouble sending upd datagram pakets to the local broadcast address. Here is a snippet of code:
After this bit of code runs, a quick netstat shows that both of the sockets are open as far as the OS is concerned:
However, running a sniff with Wireshark reveals that no data is actually put on the wire by the "write to socket" command. I've generally had success with socket based communication with Live Code, including multicasting, but I'm having no luck with broadcast. Do I appear to be missing something, or is this a known issue / limitation?
Any advice would be appreciated.
Thanks,
Chay Wesley
I'm having trouble sending upd datagram pakets to the local broadcast address. Here is a snippet of code:
Code: Select all
local OWServerDiscoverySocket_tx = "255.255.255.255:30303"
local OWServerDiscoverySocket_rx = 30303
command DiscoverOWServers
if OWServerDiscoverySocket_tx is not in the openSockets then
accept datagram connections on port OWServerDiscoverySocket_rx with message "OWServerDiscovery_ResponseReceived"
open datagram socket to OWServerDiscoverySocket_tx
if the result is not empty then answer the result
end if
write ("Discovery: Who is out there?") to socket OWServerDiscoverySocket_tx
end DiscoverOWServers
Code: Select all
Chay-Wesleys-MacBook-Pro:~ chaywesley$ netstat -an | grep 30303
udp4 0 0 172.16.10.27.60140 255.255.255.255.30303
udp4 0 0 *.30303 *.*
Any advice would be appreciated.
Thanks,
Chay Wesley