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

◆ GetSocketOption() [3/3]

byte[] System.Net.Sockets.Socket.GetSocketOption ( SocketOptionLevel optionLevel,
SocketOptionName optionName,
int optionLength )
inline

Definition at line 2278 of file Socket.cs.

2279 {
2281 byte[] array = new byte[optionLength];
2283 SocketError sockOpt = SocketPal.GetSockOpt(_handle, optionLevel, optionName, array, ref optionLength2);
2284 if (System.Net.NetEventSource.Log.IsEnabled())
2285 {
2286 System.Net.NetEventSource.Info(this, $"GetSockOpt returns errorCode:{sockOpt}", "GetSocketOption");
2287 }
2288 if (sockOpt != 0)
2289 {
2291 }
2293 {
2294 byte[] array2 = new byte[optionLength2];
2295 Buffer.BlockCopy(array, 0, array2, 0, optionLength2);
2296 array = array2;
2297 }
2298 return array;
2299 }
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
SafeSocketHandle _handle
Definition Socket.cs:533
void UpdateStatusAfterSocketErrorAndThrowException(SocketError error, [CallerMemberName] string callerName=null)
Definition Socket.cs:3715

References System.Net.Sockets.Socket._handle, System.array, System.Buffer.BlockCopy(), System.Net.Sockets.SocketPal.GetSockOpt(), System.Net.NetEventSource.Info(), System.Net.NetEventSource.Log, System.Net.Sockets.Socket.ThrowIfDisposed(), and System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException().