如何在python 2.7.5中使用socket.SOCK_RAW?

时间:2019-03-18 03:26:14

标签: python

pinpoint@moniser:/zabbix/app/bin$ python
Python 2.7.5 (default, Jul 13 2018, 13:06:57) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> serversocket=socket.socket(socket.AF_INET,socket.SOCK_RAW,socket.IPPROTO_IP)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/socket.py", line 187, in __init__
    _sock = _realsocket(family, type, proto)
socket.error: [Errno 93] Protocol not supported
>>> 

如何在python 2.7.5中使用socket.SOCK_RAW
我可以安装任何东西吗?
我也在python 3.5.5中遇到错误。
我不需要socket.SOCK_STREAM或socket.SOCK_DGRAM。

0 个答案:

没有答案