Socket.IOcontrol handles Windows-specific control codes and is not supported in linux
From @ms0713 on November 23, 2017 5:53
Using DllImport in my .Net code, I was using ws2_32.dll. While running same in Linux it says dll cant be load. So I stopped using DllImport and used Socket.IOControl() to read my data from socket. This time linux gives following error: Socket.IOControl handles Windows -specific control codes and is not supported in linux.
What could be the common way to recieve data in Windows and Linux???
Copied from original issue: dotnet/coreclr#15194
What could be the common way to recieve data in Windows and Linux???
@ms0713, what option are you using with IOControl?
@stephentoub I m using FIONREAD (1074030207), optionInvalue as null and optionOutValue as byte[]. So it goes as Socket.IOControl(FIONREAD, null, byte[]);
using FIONREAD
Can you instead use Socket.Available?
No reply for a week, closing. Let us know if the above is not enough.
FIONREAD is implemented in https://github.com/dotnet/corefx/pull/25579, anyway.