Example #1
0
 protected override void OnStop()
 {
     mqtt.Log("Trying to stop service");
     mqtt.mqttDisconnect();
     mqtt.Log("Service stopped");
     mqtt = null;
 }
Example #2
0
        protected override void OnStart(string[] args)
        {
            mqtt         = new ContWinMQTT(ContWinMQTT.Type.Service);
            mqtt.hWindow = this.ServiceHandle;
            mqtt.Log("Service started");

            bool result = mqtt.mqttSetup();

            if (!result)
            {
                this.Stop();
            }
        }