private Thread workerThread = null;
        
private Subscriber sub;

        
public DataReceiveService()
        {
            InitializeComponent();
            CanShutdown 
= true;
            CanStop 
= true;
            sub 
= new Subscriber();
        }

        
protected override void OnStart(string[] args)
        {
            EventLog.WriteEntry(
"Start Server: " + DateTime.Now.ToString());
            workerThread 
= new Thread(new ThreadStart(ServiceWorkerMethod));
            workerThread.Start();
        }

        
protected override void OnStop()
        {
            ReciveDataStatus.StopReviceDate 
= true;
        }

        
public void ServiceWorkerMethod()
        {
            sub.StartSubscriber();
        }

相关文章:

  • 2022-12-23
  • 2021-06-05
  • 2022-02-08
  • 2021-08-16
  • 2021-08-08
  • 2021-09-03
猜你喜欢
  • 2022-02-17
  • 2021-10-27
  • 2022-12-23
  • 2022-01-14
  • 2021-08-27
  • 2022-12-23
相关资源
相似解决方案