Open ajinumoto opened 1 year ago
Problem: Every time migrateConnection() is called, new NWConnection will be created. The problem appear if migrateConnection() is called multiple time, the previous NWConnection from migratedConnection variable is never closed and multiple NWConnection will be alive.
Solution change migratedConnection to global variable and make sure its cancel() and nil first before creating new one.
Fix multiple NWConnection during migrateConnection