runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Socket.IOcontrol handles Windows-specific control codes and is not supported in linux

Open jkotas opened this issue 9 years ago • 5 comments

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

jkotas avatar Nov 23 '17 15:11 jkotas

What could be the common way to recieve data in Windows and Linux???

@ms0713, what option are you using with IOControl?

stephentoub avatar Nov 25 '17 11:11 stephentoub

@stephentoub I m using FIONREAD (1074030207), optionInvalue as null and optionOutValue as byte[]. So it goes as Socket.IOControl(FIONREAD, null, byte[]);

ms0713 avatar Nov 29 '17 10:11 ms0713

using FIONREAD

Can you instead use Socket.Available?

stephentoub avatar Nov 29 '17 12:11 stephentoub

No reply for a week, closing. Let us know if the above is not enough.

karelz avatar Dec 07 '17 00:12 karelz

FIONREAD is implemented in https://github.com/dotnet/corefx/pull/25579, anyway.

stephentoub avatar Dec 07 '17 01:12 stephentoub