// Token: 0x06000009 RID: 9 RVA: 0x0000215C File Offset: 0x0000035C
 public void OnStartBegin()
 {
     this.isStarted = true;
     Configuration.Initialize(this.eventLog, new Action(this.serviceManager.StopService));
     if (!Configuration.ServiceEnabled)
     {
         AddressBookService.GeneralTracer.TraceDebug(0L, "The service is not enabled.");
         return;
     }
     AddressBookService.InitializePerfCounters(new AddressBookPerformanceCounters());
     NspiPropMapper.Initialize();
     this.RegisterServicePrincipalNames();
     ADSession.DisableAdminTopologyMode();
     this.serviceManager.AddHttpPort(6001.ToString());
     NspiServer.Initialize(this.serviceManager, this.eventLog);
     RfriServer.Initialize(this.serviceManager, this.eventLog);
     if (Configuration.ProtocolLoggingEnabled)
     {
         if (string.IsNullOrEmpty(Configuration.LogFilePath))
         {
             this.eventLog.LogEvent(AddressBookEventLogConstants.Tuple_BadConfigParameter, "LogFilePath", new object[]
             {
                 Configuration.LogFilePath
             });
             return;
         }
         ProtocolLog.Initialize(ExDateTime.UtcNow, Configuration.LogFilePath, TimeSpan.FromHours((double)Configuration.MaxRetentionPeriod), Configuration.MaxDirectorySize, Configuration.PerFileMaxSize, Configuration.ApplyHourPrecision);
     }
 }
示例#2
0
 internal static void Start()
 {
     ServerFqdnCache.InitializeCache();
     if (RfriServer.instance == null)
     {
         bool flag = false;
         try
         {
             RfriServer.instance = (RfriServer)RpcServerBase.RegisterAutoListenInterfaceSupportingAnonymous(typeof(RfriServer), RpcServerBase.DefaultMaxRpcCalls, "Microsoft Exchange RFR Interface", true);
             flag = true;
         }
         catch (RpcException ex)
         {
             RfriServer.ReferralTracer.TraceError <string>(0L, "Error registering the RFR RPC interface: {0}", ex.Message);
             RfriServer.eventLog.LogEvent(AddressBookEventLogConstants.Tuple_RpcRegisterInterfaceFailure, string.Empty, new object[]
             {
                 "RFR",
                 ServiceHelper.FormatWin32ErrorString(ex.ErrorCode)
             });
         }
         finally
         {
             if (!flag)
             {
                 RfriServer.rfriAsyncDispatch = null;
                 RfriServer.Stop();
                 RfriServer.instance = null;
             }
         }
     }
 }
 // Token: 0x0600000C RID: 12 RVA: 0x00002334 File Offset: 0x00000534
 public void OnStopBegin()
 {
     NspiServer.ShuttingDown();
     RfriServer.ShuttingDown();
 }