/// <summary> /// Retrieves all <see cref="IStatusReport" />s created by all applications currently active in the P2P network. /// </summary> /// <returns></returns> public static IEnumerable <IStatusReport> GetRemoteReports() { IContact bootstrapper = BootstrapperNode.GetContacts().FirstOrDefault(); if (bootstrapper == null) { return(new List <IStatusReport>()); } try { using ( ServiceProxy <IDebugServiceHost> proxy = new ServiceProxy <IDebugServiceHost>(bootstrapper.DebugUrl())) { return(proxy.Context.GetReports()); } } catch (Exception ex) { if (!Kernel.Exceptions.Exception.IsEndpointDown(ex)) { Log.Error(ex); } } return(new List <IStatusReport>()); }
public void Execute(ShutdownArgs args) { foreach (IPeer peer in Peer.Peers) { peer.Dispose(); } BootstrapperNode.DisposeInstance(); }
/// <summary> /// Event raised when the service is started. /// </summary> /// <param name="args"></param> protected override void OnStart(string[] args) { try { _bootstrapper = new BootstrapperNode(); _debugServiceHost = new DebugServiceHost(_bootstrapper.Node.Contact.DebugUrl()); _debugServiceHost.Initialize(); } catch (Exception ex) { Log.Error(ex); } }
/// <summary> /// Stores an <see cref="StatusReport" /> remotely. /// </summary> public void StoreRemotely() { foreach (IContact bootstrapper in BootstrapperNode.GetContacts()) { try { using ( ServiceProxy <IDebugServiceHost> proxy = new ServiceProxy <IDebugServiceHost>(bootstrapper.DebugUrl())) { proxy.Context.Deliver(this); } } catch (Exception ex) { if (!Kernel.Exceptions.Exception.IsEndpointDown(ex)) { Log.Error(ex); } } } }