Page 1 of 1

Detach & Removed Side Effects?

Posted: Wed Dec 27, 2023 3:18 pm
by Steve
Hello,

Looking for any guidance/documentation regarding any possible side effects when resources 'go away' (Server/Hub/Sensor/Ports) from a Wireless VINT Hub based system.

https://www.phidgets.com/?view=api (Manager) reads in part:

"Phidget channels that become available will each send an Attach event, and Phidgets that are removed from the system will send corresponding Detach events. If you are using a Phidget Manager, your program is responsible for keeping track of available Phidgets using these events."

This is all fine and well, but I am wondering if there are side effects when specific objects are removed or detached. For example, if the Manager tells me that the Hub has detached, does that mean that everything that depends on the Hub (such as plugged-in Sensors or the built-in Modes) should now be considered 'invalid' and references discarded? Similarly, if I get an event telling me that a Server has been removed, does that invalidate the corresponding Hub (which would then cascade down to the sensors/modes/etc.)?

I know that with the Phidget22 event model everything comes in 'flat' but there still is an implicit hierarchy and thus my question. I am always looking to increase the resilience my code and am currently looking into servers disconnecting somewhat consistently after about eight hours of run time.

Thanks.

Re: Detach & Removed Side Effects?

Posted: Tue Jan 02, 2024 12:28 pm
by Patrick
You will always see detach events for child devices before the parent devices in the case of a hub or server detaching.