System.Net.NetEventSource.Enter C# (CSharp) Method

Enter() public static method

public static Enter ( object thisOrContextObject, object arg1 = null, object arg2 = null, object arg3 = null ) : void
thisOrContextObject object
arg1 object
arg2 object
arg3 object
return void
        public static void Enter(object thisOrContextObject, object arg1 = null, object arg2 = null, object arg3 = null) { }
        public static void Fail(object thisOrContextObject, object arg) { }

Usage Example

示例#1
0
        public static IPHostEntry EndResolve(IAsyncResult asyncResult)
        {
            if (NetEventSource.IsEnabled)
            {
                NetEventSource.Enter(null, asyncResult);
            }
            IPHostEntry ipHostEntry;

            try
            {
                ipHostEntry = TaskToApm.End <IPHostEntry>(asyncResult);
            }
            catch (SocketException ex)
            {
                IPAddress?address = asyncResult switch
                {
                    Task t => t.AsyncState as IPAddress,
                         TaskToApm.TaskAsyncResult twar => twar._task.AsyncState as IPAddress,
                         _ => null
                };

                if (address is null)
                {
                    throw; // BeginResolve was called with a HostName, not an IPAddress
                }
                if (NetEventSource.IsEnabled)
                {
                    NetEventSource.Error(null, ex);
                }
                ipHostEntry = CreateHostEntryForAddress(address);
            }

            if (NetEventSource.IsEnabled)
            {
                NetEventSource.Exit(null, ipHostEntry);
            }
            return(ipHostEntry);
        }
All Usage Examples Of System.Net.NetEventSource::Enter