Don't know why I'm getting Error Code 10022 (Invalid Argument) when setting socket options in my C# sniffer

て烟熏妆下的殇ゞ 提交于 2019-12-04 11:52:07
Scott Chamberlain

Microsoft has restricted the use of raw sockets on non-server editions of the the windows OS on all OS's newer than XP SP2, due to abuse by viruses in the early 2000's.

You can read more on what restrictions are in place from the page on TCP/IP Raw Sockets on the MSDN.

WSAEINVAL 10022

Invalid argument.

Some invalid argument was supplied (for example, specifying an invalid level to the setsockopt function). In some instances, it also refers to the current state of the socket—for instance, calling accept on a socket that is not listening.

Take a look about this error here: http://msdn.microsoft.com/en-us/library/ms740668(v=vs.85).aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!