10[
EventSource(
Name =
"Private.InternalDiagnostics.System.Net.Sockets", LocalizationResources =
"FxResources.System.Net.Sockets.SR")]
32 private void Accepted(
string remoteEp,
string localEp,
int socketHash)
47 private void Connected(
string localEp,
string remoteEp,
int socketHash)
75 Log.DumpBuffer(
IdOf(thisOrContextObject), memberName, buffer2);
80 public static void Info(
object thisOrContextObject,
FormattableString formattableString =
null, [CallerMemberName]
string memberName =
null)
84 Log.Info(
IdOf(thisOrContextObject), memberName, (formattableString !=
null) ?
Format(formattableString) :
"");
89 public static void Info(
object thisOrContextObject,
object message, [CallerMemberName]
string memberName =
null)
98 private void Info(
string thisOrContextObject,
string memberName,
string message)
100 WriteEvent(4, thisOrContextObject, memberName ??
"(?)", message);
104 public static void Error(
object thisOrContextObject,
FormattableString formattableString, [CallerMemberName]
string memberName =
null)
108 Log.ErrorMessage(
IdOf(thisOrContextObject), memberName,
Format(formattableString));
113 public static void Error(
object thisOrContextObject,
object message, [CallerMemberName]
string memberName =
null)
122 private void ErrorMessage(
string thisOrContextObject,
string memberName,
string message)
124 WriteEvent(5, thisOrContextObject, memberName ??
"(?)", message);
139 Log.DumpBuffer(
IdOf(thisOrContextObject), memberName,
array);
144 public unsafe
static void DumpBuffer(
object thisOrContextObject,
IntPtr bufferPtr,
int count, [CallerMemberName]
string memberName =
null)
153 Log.DumpBuffer(
IdOf(thisOrContextObject), memberName,
array);
176 return value?.GetHashCode() ?? 0;
193 return $
"{array.GetType().GetElementType()}[{((Array)value).Length}]";
197 return $
"{collection.GetType().Name}({collection.Count})";
201 return $
"{safeHandle.GetType().Name}:{safeHandle.GetHashCode()}(0x{safeHandle.DangerousGetHandle():X})";
205 return $
"0x{value:X}";
207 string text2 =
value.ToString();
208 if (text2 ==
null || text2 ==
value.GetType().FullName)
218 switch (
s.ArgumentCount)
223 return string.Format(
s.Format,
Format(
s.GetArgument(0)));
225 return string.Format(
s.Format,
Format(
s.GetArgument(0)),
Format(
s.GetArgument(1)));
227 return string.Format(
s.Format,
Format(
s.GetArgument(0)),
Format(
s.GetArgument(1)),
Format(
s.GetArgument(2)));
230 object[] arguments =
s.GetArguments();
231 object[]
array =
new object[arguments.Length];
232 for (
int i = 0; i < arguments.Length; i++)
236 return string.Format(
s.Format,
array);
241 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
243 private unsafe
void WriteEvent(
int eventId,
string arg1,
string arg2,
byte[] arg3)
246 if (!
Log.IsEnabled())
260 arg3 =
Array.Empty<
byte>();
262 fixed (
char* ptr5 = arg1)
274 intPtr = (ptr =
null);
276 fixed (
byte* ptr2 =
array)
284 DataPointer = (
IntPtr)ptr5,
285 Size = (arg1.Length + 1) * 2
287 num = (nint)(ptr4 + 1);
290 DataPointer = (
IntPtr)ptr,
291 Size = (arg2.Length + 1) * 2
293 num2 = (nint)(ptr4 + 2);
296 DataPointer = (
IntPtr)(&size),
299 num3 = (nint)(ptr4 + 3);
302 DataPointer = (
IntPtr)ptr3,
309 fixed (
char* ptr6 = &arg2.GetPinnableReference())
312 intPtr = (ptr = ptr6);
314 fixed (
byte* ptr2 =
array)
322 DataPointer = (
IntPtr)ptr5,
323 Size = (arg1.Length + 1) * 2
325 num = (nint)(ptr4 + 1);
328 DataPointer = (
IntPtr)ptr,
329 Size = (arg2.Length + 1) * 2
331 num2 = (nint)(ptr4 + 2);
334 DataPointer = (
IntPtr)(&size),
337 num3 = (nint)(ptr4 + 3);
340 DataPointer = (
IntPtr)ptr3,
349 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
351 private unsafe
void WriteEvent(
int eventId,
string arg1,
string arg2,
int arg3)
354 if (!
Log.IsEnabled())
366 fixed (
char* ptr3 = arg1)
375 intPtr = (ptr =
null);
380 DataPointer = (
IntPtr)ptr3,
381 Size = (arg1.Length + 1) * 2
383 num = (nint)(ptr2 + 1);
386 DataPointer = (
IntPtr)ptr,
387 Size = (arg2.Length + 1) * 2
389 num2 = (nint)(ptr2 + 2);
392 DataPointer = (
IntPtr)(&arg3),
398 fixed (
char* ptr4 = &arg2.GetPinnableReference())
401 intPtr = (ptr = ptr4);
406 DataPointer = (
IntPtr)ptr3,
407 Size = (arg1.Length + 1) * 2
409 num = (nint)(ptr2 + 1);
412 DataPointer = (
IntPtr)ptr,
413 Size = (arg2.Length + 1) * 2
415 num2 = (nint)(ptr2 + 2);
418 DataPointer = (
IntPtr)(&arg3),
static unsafe void MemoryCopy(void *source, void *destination, long destinationSizeInBytes, long sourceBytesToCopy)
static void BlockCopy(Array src, int srcOffset, Array dst, int dstOffset, int count)
unsafe void WriteEventCore(int eventId, int eventDataCount, EventData *data)
override string ToString()
static byte Min(byte val1, byte val2)
const EventKeywords Default
void DumpBuffer(string thisOrContextObject, string memberName, byte[] buffer)
static void ConnectedAsyncDns(Socket socket)
static readonly System.Net.NetEventSource Log
void ErrorMessage(string thisOrContextObject, string memberName, string message)
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static void Error(object thisOrContextObject, object message, [CallerMemberName] string memberName=null)
void Info(string thisOrContextObject, string memberName, string message)
unsafe void WriteEvent(int eventId, string arg1, string arg2, int arg3)
static string IdOf(object value)
static string Format(FormattableString s)
static void Error(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string memberName=null)
void Connected(string localEp, string remoteEp, int socketHash)
static int GetHashCode(object value)
unsafe void WriteEvent(int eventId, string arg1, string arg2, byte[] arg3)
unsafe void WriteEvent(int eventId, int arg1, int arg2, int arg3, string arg4, string arg5)
static void Connected(Socket socket, object localEp, object remoteEp)
static void DumpBuffer(object thisOrContextObject, Memory< byte > buffer, int offset, int count, [CallerMemberName] string memberName=null)
static void Accepted(Socket socket, object remoteEp, object localEp)
static void Info(object thisOrContextObject, object message, [CallerMemberName] string memberName=null)
static object Format(object value)
void Accepted(string remoteEp, string localEp, int socketHash)
static unsafe void DumpBuffer(object thisOrContextObject, IntPtr bufferPtr, int count, [CallerMemberName] string memberName=null)
void ConnectedAsyncDns(int socketHash)
static void DumpBuffer(object thisOrContextObject, byte[] buffer, int offset, int count, [CallerMemberName] string memberName=null)