StopListening Method
StopListening()
Disposes and closes the singleton instance of YubiKeyDeviceListener.
public static void StopListening()
Remarks
Enumerating YubiKeys is actually done via a cache. As such, this cache must be maintained and kept up-to-date. This is done by starting several listeners that run in the background. These listen for the relevant OS device arrival and removal events.
Normally, these background listeners will run starting with the first enumeration call to the SDK and remain active until the process shuts down. But there are cases where you may not want the overhead of these listeners running all the time. While they do their best to not consume excessive resources, they can sometimes generate log noise, exceptions, etc.
This method allows you to stop these background listeners and reclaim resources, as possible. This will not invalidate any existing IYubiKeyDevice instances, however you will not receive any additional events regarding that device. Any subsequent calls to FindAll(), FindByTransport(Transport), or Instance will restart the listeners.