@kovid: after a wireless device opens a socket, the wireless device driver waits for up to 6 seconds to be polled to open a connection. Is it reasonable that this isn't long enough? Device.py runs the loop every 2 seconds. I don't know how long the scan takes, but it is clearly less that 4 seconds if nothing is plugged in.
What I am worried about is if for some reason the previous device is not in "ejected_devices" then all sorts of processing might happen trying to open the previously ejected device. I see timeouts of 5 seconds and 7 seconds in the device subsystem in usbms.
Perhaps this problem could go away if the wireless device driver were at the top of the device scan list? It responds very quickly whether or not a device is waiting to connect.
|