示例#1
0
 /// <summary>
 /// Opens a service endpoint for the PerfMonCollector that other clients can talk to
 /// </summary>
 private void LoadServiceEndpoint()
 {
     if (_serviceEndpoint == null)
     {
         _commandService  = VirtualResourceManagementConnection.CreateServiceHost(Environment.MachineName, (int)WcfService.VirtualResource);
         _serviceEndpoint = _commandService.BaseAddresses[0];
         _commandService.Open();
     }
 }
 /// <summary>
 /// Override so that child controllers can establish their own service host
 /// </summary>
 /// <param name="port"></param>
 /// <returns></returns>
 protected virtual ServiceHost CreateServiceHost(int port)
 {
     TraceFactory.Logger.Debug("Creating endpoint");
     return(VirtualResourceManagementConnection.CreateServiceHost(Environment.MachineName, port));
 }
 protected override ServiceHost CreateServiceHost(int port)
 {
     TraceFactory.Logger.Debug("Creating endpoint");
     return(VirtualResourceManagementConnection.CreateServiceHost("localhost", Guid.NewGuid().ToShortString()));
 }
示例#4
0
 /// <summary>
 /// Registers the resource using the currently defined management endpoint.
 /// </summary>
 /// <param name="resourceName">Name of the resource.</param>
 /// <exception cref="System.InvalidOperationException">Unable to start service.</exception>
 protected void OpenManagementServiceEndpoint(string resourceName)
 {
     _managementService = VirtualResourceManagementConnection.CreateServiceHost(Environment.MachineName, (int)WcfService.VirtualResource);
     _managementService.Open();
     ServiceEndpoint = _managementService.BaseAddresses[0];
 }