Hi,

On 10 February 2012 14:12, daedae11 <daeda...@126.com> wrote:
> Traceback (most recent call last):
>   File "E:\c language\Eclipse\example\src\sniffer.py", line 12, in <module>
>     s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP)
>   File "D:\Python27\lib\socket.py", line 187, in __init__
>     _sock = _realsocket(family, type, proto)
> socket.error: [Errno 10013]

A bit of googling suggests that "ErrNo 10013" means "Access denied".
The error therefore presumably results because raw sockets require
elevated (Administrator) privileges.  The documentation you're
referring to actually states as much: "The last example shows how to
write a very simple network sniffer with raw sockets on Windows. The
example requires administrator privileges to modify the interface:"
So I conclude you need to run your script as administrator (and
apparently have not done so above.)

Walter
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to