error with examples (UDP broadcast)

Damir Hakimov damir at agg.astranet.ru
Mon Aug 8 01:22:36 EDT 2005


Hi All!

I'm writing a small programm which must send and service UDP broadcast 
packets.
As start of it I looked at
/usr/share/doc/python2.4/Examples/Demo/sockets/broadcast.py

damir at debian-IBM:/usr/share/doc/python2.4/examples/Demo/sockets$ 
python2.4 broadcast.py
Traceback (most recent call last):
  File "broadcast.py", line 14, in ?
    s.sendto(data, ('<broadcast>', MYPORT))
socket.error: (101, 'Network is unreachable')
damir at debian-IBM:/usr/share/doc/python2.4/examples/Demo/sockets$

If I replace '<broadcast>' to '192.168.10.255' (this is my network's 
broadcast addres) it's working fine.
Were is the truble?

Damir.




More information about the Python-list mailing list