code: def close(self):
          # type: () -> None
          
          if not self._open:
              return
  
          if linux:
              adsDelRoute(self._adr.netIdStruct())
  
          if self._port is not None:
              adsPortCloseEx(self._port)
              self._port = None
  
          self._open = False
docs: :summary: Close the connection to the TwinCAT message router.