2,782 questions
SOCK_RAW and IPPROTO_TCP is error running python code,the error is WinError 10022
bertram
1
Reputation point
import socket
def tcpsniffer():
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_TCP)
while True:
packet = s.recvfrom(1024)
print('recvfrom packet!')
if name == 'main':
tcpsniffer()
Windows development Windows API - Win32
Sign in to answer