Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Support of raw socket in dotnet core 2

$
0
0

Hi All,

I'm currently working with C# on .net core 2  on:

- x86 windows,

- x86 linux,

- ARM linux

I would like to use raw socket in my C# solution.

On windows everything works fine, on linux (x86 and ARM) i get en error:

" Unhandled Exception: System.Net.Sockets.SocketException: Protocol not supported

at System.Net.Sockets.Socket..ctor(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType) "

Some code that throws that exception:

mainSocket = new Socket(AddressFamily.InterNetwork,SocketType.Raw, ProtocolType.IP);

And my question is:

1st.  - It this possible to get a raw socket using C# and .net 2 on any linux distribution?

2nd. - If not how to get a raw data from physical network interface under linux using C# ?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>