System.Net.Sockets.SocketPal.WindowsIoctl C# (CSharp) Метод

WindowsIoctl() публичный статический Метод

public static WindowsIoctl ( SafeCloseSocket handle, int ioControlCode, byte optionInValue, byte optionOutValue, int &optionLength ) : SocketError
handle SafeCloseSocket
ioControlCode int
optionInValue byte
optionOutValue byte
optionLength int
Результат SocketError
        public static SocketError WindowsIoctl(SafeCloseSocket handle, int ioControlCode, byte[] optionInValue, byte[] optionOutValue, out int optionLength)
        {            
            throw new PlatformNotSupportedException();
        }

Usage Example

Пример #1
1
        public static SocketError Set(SafeSocketHandle handle, SocketOptionName optionName, int optionValueSeconds)
        {
            IOControlKeepAlive ioControlKeepAlive = s_socketKeepAliveTable.GetOrCreateValue(handle);

            if (optionName == SocketOptionName.TcpKeepAliveTime)
            {
                ioControlKeepAlive._timeMs = SecondsToMilliseconds(optionValueSeconds);
            }
            else
            {
                ioControlKeepAlive._intervalMs = SecondsToMilliseconds(optionValueSeconds);
            }

            byte[] buffer = s_keepAliveValuesBuffer ?? (s_keepAliveValuesBuffer = new byte[3 * sizeof(uint)]);
            ioControlKeepAlive.Fill(buffer);
            int realOptionLength = 0;

            return(SocketPal.WindowsIoctl(handle, unchecked ((int)IOControlCode.KeepAliveValues), buffer, null, out realOptionLength));
        }