Пример #1
0
        /// <summary>
        /// Start data service
        /// </summary>
        private void StartDataWcfService()
        {
            string dataServiceAddress = SoaHelper.GetDataServiceAddress();

            this.dataServiceHost = new ServiceHost(this.dataService, new Uri(dataServiceAddress));
            BindingHelper.ApplyDefaultThrottlingBehavior(this.dataServiceHost);

            Binding binding = BindingHelper.HardCodedDataServiceNetTcpBinding;

            binding.SendTimeout    = TimeSpan.FromMinutes(Microsoft.Hpc.Scheduler.Session.Data.Internal.Constant.DataProxyOperationTimeoutInMinutes);
            binding.ReceiveTimeout = TimeSpan.FromMinutes(Microsoft.Hpc.Scheduler.Session.Data.Internal.Constant.DataProxyOperationTimeoutInMinutes);
            this.dataServiceHost.AddServiceEndpoint(typeof(Microsoft.Hpc.Scheduler.Session.Data.Internal.IDataService), binding, string.Empty);

            // Bug 14900: for some unknown reason, service host may enter into Faulted state and
            // become unresponsive to client requests. Here register the Faulted event. If it
            // occurs, restart the service host.
            this.dataServiceHost.Faulted += DataServiceHostFaultHandler;
            this.dataServiceHost.Open();

            TraceHelper.TraceEvent(TraceEventType.Information, "Open SOA data service at {0}", dataServiceAddress);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the DataServiceAgent class
 /// </summary>
 /// <param name="headNode">cluster head node name</param>
 public DataServiceAgent(string headNode, TransportScheme scheme)
     : this(new Uri(SoaHelper.GetDataServiceAddress(headNode, scheme)))
 {
     this.scheme = scheme;
 }