i'm learning udp with you.  but repeating snippets from the above, the 
following works for me (i seem to be both broadcasting and sending 
directly, so i don't think it's completely correct, but at least i receive 
something):

julia> s = UdpSocket()
UdpSocket(Ptr{Void} @0x0000000005bad480,1,Condition({}),Condition({}),
Condition({}))

julia> bind(s, IPv4(127,0,0,1), 9998)
true

julia> println(recv(s))
104                                                                         
    
101                                                                         
    
108                                                                         
    
108                                                                         
    
111                                                                         
    
32                                                                         
     
119                                                                         
    
111                                                                         
    
114                                                                         
    
108                                                                         
    
100   

julia> s = UdpSocket()
UdpSocket(Ptr{Void} @0x00000000026c88d0,1,Condition({}),Condition({}),
Condition({}))

julia> bind(s, IPv4(127,0,0,1), 9999)
true

julia> Base.setopt(s, enable_broadcast=1)

julia> send(s, IPv4(127,0,0,1), 9998, b"hello world")

this is on linux, with a very recent julia 0.3 (built from git).

i think my previous problem was because i didn't bind before setopt.

the need for Base.setop() rather than simple setopt() is because this is 
new code and the author wasn't sure whether it should be made public or 
not.  presumably it will change at some point.  if you look at the source, 
presumably setopy isn't included in the "exports" part of the module, at 
the top.

hope that helps.

julia is still very much under development, so things sometimes aren't so 
polished...

andrew                                  

Reply via email to