So if we have PeerListener listening for peers on an interface it has a couple of open sockets using that interface. This is all find and dandy even if the interface has nothing plugged in, because any interface is possible to bind on and has the needed fe80 address assigned by the operating system.
The issue is this, while we are building the uci interface we will then listen on during port function toggling the interface doesn’t actually exist, we need to add it to the listen list about a minute after we end execution of this function to give the OS time to finish the refresh of the settings and assign addresses to the new interface. This task is handled for us during boot because we request to come up after the network target.
My current thought is to issue a future to listen to the interface after sleeping for 60 seconds (hopefully with some futures library for sleeping so that we don’t block for a whole minute. That way the interface can come back right away then come into effect a few seconds later.
The alternative is to try and do this synchronously. Which will involve an enormous wait.