def METHOD_NAME(self):
    if self.connection is not None:
        server = depot.getHandlersOfType(depot.SERVER)[0]
        server.unregister(self.callback)
        try:
            self.connection.receiveClient(None)
        except Exception as e:
            print ("Couldn't disconnect from %s: %s" % (self.serviceName, e))
        self.connection = None