Ok, a new problem. The following program outputs "received: foo". But if
I uncomment the s.connect line in the fork code, it hangs in #recv. Why
should connecting a UDPSocket to _another_ broadcast port interfere with
receiving? (I see the same behavior with 192.168.1.255 broadcasts after
turning off my firewall.)

require 'socket'

broadcast_addr = '127.255.255.255'

fork do
  s = UDPSocket.open
  s.setsockopt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, true)
  s.bind(broadcast_addr, 44891)
  #s.connect(broadcast_addr, 44890)
  puts "received: #{s.recv(100)}"
end

sleep 0.1

s = UDPSocket.open
s.setsockopt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, true)
#s.bind(broadcast_addr, 44890) # this has no effect either way
s.connect(broadcast_addr, 44891)
s.send "foo", 0

Process.wait





-- 
      vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407