Forgot:
> The lines:
> s = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP)
> s.bind(('',4500))
> while 1:    # Run until cancelled
>       message, client = s.recvfrom(1400) # <=256 byte datagram
>         hdr = s.getsockopt (SOL_IP, IP_OPTIONS, 20)
>         print "Client connected:", client
>         print "HDR:" + binascii.hexlify(hdr)
> 
If you want to test this, be rot and try

     echo asd | nc -u 127.0.0.1 4500

to create some packets ...

This should do it.
- fabiand

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to