I am writing a driver that needs to be able to dynamically create and destroy SSL connections in order to connect (and disconnect) to an indeterminate number of devices. Due to the inherent unpredictability of how many devices will be connected at a given time, I need this to be able to be done programmatically. I'm comfortable enough with Lua, and have written a few simple drivers before, but none with this type of requirement. I'm essentially looking for the opposite of C4:CreateNetworkConnection(). Can someone point me in the right direction?
I looked at the example drivers provided on C4's Github and it looks like they use C4:NetDisconnect() calls to 'remove' connections created with C4:CreateNetworkConnection(). I attempted this approach, but all it seems to do is to temporarily (until my reconnect handler executes) break the connection, without actually removing it. So far, the only thing I've found that will remove the connections is doing a driver reboot, but I'd like to avoid having to do that every time I need to remove a connection.