def close_pub(self):
        '''
        Close the publish connection (if established)
        '''
        if not self.cpub:
            return

        self.subscriber.close()
        self.subscriber = None
        self.pending_events = []
        self.cpub = False
Close the publish connection (if established)