问题描述
- python原始套接字的问题
-
代码如下:import socket addr='localhost' serversocket=socket.socket(socket.AF_INET,socket.SOCK_RAW,socket.IPPROTO_IP) serversocket.bind((addr,0)) serversocket.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1) serversocket.ioctl(socket.SIO_RCVALL,socket.RCVALL_OFF) print(serversocket.recvfrom(4096))
解决方案
http://www.jb51.net/article/47158.htm
时间: 2024-11-03 11:48:30