コード例 #1
0
    def disconnect(self):
        """
        Stop the BACnet stack.  Free the IP socket.
        """
        self._log.debug('Stopping BACnet stack')
        # Freeing socket
        try:
            self.this_application.mux.directPort.handle_close()
        except:
            self.this_application.mux.broadcastPort.handle_close()

        stopBacnetIPApp()           # Stop Core
        self._stopped = True        # Stop stack thread
        self.t.join()
        self._started = False
        self._log.info('BACnet stopped')
コード例 #2
0
ファイル: Base.py プロジェクト: ChristianTremblay/BAC0
    def disconnect(self):
        """
        Stop the BACnet stack.  Free the IP socket.
        """
        self._log.debug("Stopping BACnet stack")
        # Freeing socket
        try:
            self.this_application.mux.directPort.handle_close()
        except:
            self.this_application.mux.broadcastPort.handle_close()

        stopBacnetIPApp()  # Stop Core
        self._stopped = True  # Stop stack thread
        self.t.join()
        self._started = False
        Base._used_ips.remove(self.localIPAddr)
        self._log.info("BACnet stopped")
コード例 #3
0
ファイル: Base.py プロジェクト: farzamhm/BAC0
    def disconnect(self):
        """
        Stop the BACnet stack.  Free the IP socket.
        """
        self._log.debug("Stopping BACnet stack")
        # Freeing socket
        try:
            self.this_application.mux.directPort.handle_close()
        except:
            self.this_application.mux.broadcastPort.handle_close()

        stopBacnetIPApp()  # Stop Core
        self._stopped = True  # Stop stack thread
        self.t.join()
        self._started = False
        Base._used_ips.remove(self.localIPAddr)
        self._log.info("BACnet stopped")
コード例 #4
0
ファイル: Base.py プロジェクト: ChristianTremblay/BAC0
 def _startAppThread(self):
     """
     Starts the BACnet stack in its own thread so requests can be processed.
     As signal cannot be called in another thread than the main thread
     when calling startBacnetIPApp, we must pass None to both parameters
     """
     self._log.info("Starting app...")
     enable_sleeping(0.0005)
     self.t = Thread(
         target=startBacnetIPApp,
         kwargs={"sigterm": None, "sigusr1": None},
         daemon=True,
     )
     try:
         self.t.start()
         self._started = True
         self._log.info("BAC0 started")
     except OSError:
         stopBacnetIPApp()
         self.t.join()
         raise
コード例 #5
0
ファイル: BasicScript.py プロジェクト: hjc879227/BAC0
 def stopApp(self):
     """
     Used to stop the application
     Free the socket using ``handle_close()`` function
     Stop the thread
     """
     print('Stopping app')
     # Freeing socket
     try:
         self.this_application.mux.directPort.handle_close()
     except:
         self.this_application.mux.broadcastPort.handle_close()
     
     # Stopping Core        
     stopBacnetIPApp()
     self._stopped = True        
     # Stopping thread
     #print(Thread.is_alive)
     self.t.join()
     self._started = False
     print('App stopped')
コード例 #6
0
ファイル: BasicScript.py プロジェクト: xiaotong0202/BAC0
    def stopApp(self):
        """
        Used to stop the application
        Free the socket using ``handle_close()`` function
        Stop the thread
        """
        print('Stopping app')
        # Freeing socket
        try:
            self.this_application.mux.directPort.handle_close()
        except:
            self.this_application.mux.broadcastPort.handle_close()

        # Stopping Core
        stopBacnetIPApp()
        self._stopped = True
        # Stopping thread
        #print(Thread.is_alive)
        self.t.join()
        self._started = False
        print('App stopped')
コード例 #7
0
 def _startAppThread(self):
     """
     Starts the BACnet stack in its own thread so requests can be processed.
     As signal cannot be called in another thread than the main thread
     when calling startBacnetIPApp, we must pass None to both parameters
     """
     self._log.info("Starting app...")
     enable_sleeping(0.0005)
     self.t = Thread(
         target=startBacnetIPApp,
         kwargs={
             "sigterm": None,
             "sigusr1": None
         },
         daemon=True,
     )
     try:
         self.t.start()
         self._started = True
         self._log.info("BAC0 started")
     except OSError:
         stopBacnetIPApp()
         self.t.join()
         raise