/// <summary> /// Multicasts a test message /// </summary> /// <summary>Test messages are handled internally and results are sent via logging (as Information)</summary> /// <remarks>Test messages are handled internally and results are sent via logging (as Information)</remarks> /// <remarks> Any Fastnet web site that activates Messenger will automatically handle test messages</remarks> /// <returns></returns> public async Task SendMulticastTestAsync() { var mt = new MulticastTest(); mt.SetNumber(); mt.SourceMachine = Environment.MachineName.ToLower(); mt.SourcePID = System.Diagnostics.Process.GetCurrentProcess().Id; await SendMulticastAsync(mt); log.Information($"MulticastTest message {mt.Number} sent at {mt.DateTimeUtc.ToDefaultWithTime()}"); }
private void MulticastTestHandler(MulticastTest m) { m.ReceivedAtUtc = DateTimeOffset.UtcNow; var elapsed = m.ReceivedAtUtc - m.DateTimeUtc; var message = $"MulticastTest message {m.Number} from {m.SourceMachine}, pid {m.SourcePID} received at {m.ReceivedAtUtc.ToDefaultWithTime()} in {elapsed.TotalMilliseconds}ms"; if (elapsed.TotalMilliseconds > 250) { log.Warning($"{message} !!!!!!!!"); } else { log.Information(message); } }