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();
		}
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
 public ActivityWithHeartbeatEnabledProgrammatically(string details, TimeSpan activityExecutionTime)
 {
     _activityExecutionTime = activityExecutionTime;
     Hearbeat.Enable(TimeSpan.FromMilliseconds(HeartbeatInterval));
     Hearbeat.ProvideDetails(() => details);
 }
Esempio n. 4
0
 public ActivityWithoutHearbeat(string details, TimeSpan activityExecutionTime)
 {
     _activityExecutionTime = activityExecutionTime;
     Hearbeat.ProvideDetails(() => details);
 }
Esempio n. 5
0
 public ActivityWithHeartbeatEnabledByAttribute(string details, TimeSpan activityExecutionTime)
 {
     _activityExecutionTime = activityExecutionTime;
     Hearbeat.ProvideDetails(() => details);
 }