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

◆ SetSockOpt() [1/2]

static unsafe SocketError System.Net.Sockets.SocketPal.SetSockOpt ( SafeSocketHandle handle,
SocketOptionLevel optionLevel,
SocketOptionName optionName,
byte[] optionValue )
inlinestatic

Definition at line 492 of file SocketPal.cs.

493 {
494 if (optionLevel == SocketOptionLevel.Tcp && (optionName == SocketOptionName.TypeOfService || optionName == SocketOptionName.BlockSource) && IOControlKeepAlive.IsNeeded)
495 {
496 return IOControlKeepAlive.Set(handle, optionName, optionValue);
497 }
499 {
500 SocketError socketError = global::Interop.Winsock.setsockopt(handle, optionLevel, optionName, optionValue2, (optionValue != null) ? optionValue.Length : 0);
501 if (socketError != SocketError.SocketError)
502 {
503 return SocketError.Success;
504 }
505 return GetLastSocketError();
506 }
507 }
static SocketError GetLastSocketError()
Definition SocketPal.cs:22

References System.Net.Sockets.SocketPal.GetLastSocketError(), System.handle, System.Net.Sockets.IOControlKeepAlive.IsNeeded, and System.Net.Sockets.IOControlKeepAlive.Set().