// Starts a server or client based on the command args private void CheckArgsForConnectionInfo() { if (MDArguments.HasArg(ARG_STANDALONE)) { StartStandalone(); } // Expects -server=[port] else if (MDArguments.HasArg(ARG_SERVER)) { int Port = MDArguments.GetArgInt(ARG_SERVER); StartServer(Port); } // Expects -client=[IPAddress:Port] else if (MDArguments.HasArg(ARG_CLIENT)) { string ClientArg = MDArguments.GetArg(ARG_CLIENT); string[] HostPort = ClientArg.Split(":"); if (HostPort.Length == 2) { StartClient(HostPort[0], HostPort[1].ToInt()); } else { MDLog.Error(LOG_CAT, $"Failed to parse client arg {ClientArg}, expecting -{ARG_CLIENT}=[IPAddress:Port]"); } } }
/// <summary> /// Disposes the profiler /// </summary> public void Dispose() { Timer.Stop(); if (_enabledProfiles.Contains(LowerProfileName) || MDArguments.HasArg(LOG_ARG)) { MDLog.Info(LOG_CAT, $"Profiling [{ProfileName}] took {GetMicroSeconds()} us"); } }