Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Set() [2/2]

static SocketError System.Net.Sockets.IOControlKeepAlive.Set ( SafeSocketHandle handle,
SocketOptionName optionName,
int optionValueSeconds )
inlinestatic

Definition at line 56 of file IOControlKeepAlive.cs.

57 {
58 IOControlKeepAlive value = s_socketKeepAliveTable.GetValue(handle, (SafeSocketHandle handle) => new IOControlKeepAlive());
59 if (optionName == SocketOptionName.TypeOfService)
60 {
61 value._timeMs = SecondsToMilliseconds(optionValueSeconds);
62 }
63 else
64 {
65 value._intervalMs = SecondsToMilliseconds(optionValueSeconds);
66 }
67 byte[] array = s_keepAliveValuesBuffer ?? (s_keepAliveValuesBuffer = new byte[12]);
68 value.Fill(array);
69 int optionLength = 0;
70 return SocketPal.WindowsIoctl(handle, -1744830460, array, null, out optionLength);
71 }
static readonly ConditionalWeakTable< SafeSocketHandle, IOControlKeepAlive > s_socketKeepAliveTable
static uint SecondsToMilliseconds(int seconds)

References System.array, System.handle, System.Net.Sockets.IOControlKeepAlive.s_keepAliveValuesBuffer, System.Net.Sockets.IOControlKeepAlive.s_socketKeepAliveTable, System.Net.Sockets.IOControlKeepAlive.SecondsToMilliseconds(), System.value, and System.Net.Sockets.SocketPal.WindowsIoctl().