title: OSError: [WinError 10022] An invalid argument was supplied - Windows 10 Python
body: <p>I am currently learning python, coming from java, and stumbled into an error I can't find the answer to. I am using the latest python version on Windows 10, though I assume the tutorial I followed was meant for Linux... Hope you can still help me out. This is my classcode:</p>
  
  <pre><code>def main():
      connection = socket.socket(socket.AF_INET, socket.SOCK_RAW, 
      socket.IPPROTO_IP)
  
      #mainloop
      raw_data, addr = connection.recvfrom(65536)
      dest_mac, src_mac, eth_proto, data = ethernet_frame(raw_data)
      print('\nEthernet Frame:')
      print('Destination: {}, Source: {}, Protocol: {}'.format(dest_mac, 
      src_mac, eth_proto))
  
  #unpack ethernet frame
  def ethernet_frame(data):
      dest_mac, src_mac, proto = struct.unpack('! 6s 6s H', data[:14])
  
      return get_mac_addr(dest_mac), get_mac_addr(src_mac), 
      socket.htons(proto), data[14:]
  
  #format MAC adress
  def get_mac_addr(bytes_addr):
      bytes_str = map('{:02x}'.format, bytes_addr)
  
      return ':'.join(bytes_str).upper()
  
  main()
  </code></pre>
  
  <p>On execution I receive following Error:</p>
  
  <pre><code>OSError: [WinError 10022] An invalid argument was supplied
  </code></pre>
  
  <p>in the line with "connection.recvfrom(65536)".</p>
  
  <p>Is this a windows specific error?</p>