I was playing with raw sockets on my Windows 8 machine. I created a socket as follows:
s=socket(AF_INET,SOCK_RAW,IPPROTO_TCP)
s.bind((gethostname(),0)) s.ioctl(SIO_RCVALL,RCVALL_ON)
But on binding line python is throwing an exception as follows
OSError: [WinError 10022] An invalid argument was supplied
But with IPPROTO_UDP
as the third argument, it's working fine.
I also have an AWS machine running Windows 10, on which it's working fine with same third argument (IPPROTO_TCP)
Why am I getting this error?