static public void RunServer() { _heartbeat = new Hearbeat(); ElevatedService service = new ElevatedService(_heartbeat); ServiceHost sh = new ServiceHost(service, new Uri("net.pipe://localhost/myPipe")); NetNamedPipeBinding np = new NetNamedPipeBinding(); sh.AddServiceEndpoint(typeof(IElevatedOperationsInterface), np, "elevatedServices"); sh.Open(); _heartbeat.Beat(); //give parent time to connect waitForDebugger(); while (isParentProcessAlive()) { _heartbeat.Reset(); Thread.Sleep(60000); } sh.Close(); }
public ActivityWithHeartbeatEnabledProgrammatically(string details, TimeSpan activityExecutionTime) { _activityExecutionTime = activityExecutionTime; Hearbeat.Enable(TimeSpan.FromMilliseconds(HeartbeatInterval)); Hearbeat.ProvideDetails(() => details); }
public ActivityWithoutHearbeat(string details, TimeSpan activityExecutionTime) { _activityExecutionTime = activityExecutionTime; Hearbeat.ProvideDetails(() => details); }
public ActivityWithHeartbeatEnabledByAttribute(string details, TimeSpan activityExecutionTime) { _activityExecutionTime = activityExecutionTime; Hearbeat.ProvideDetails(() => details); }