As seen in the screenshot of the initializer a new URLSession is created for every client instance. However because there is no deinit block added to the class, session.invalidateAndCancel() is never called when the client is destroyed, resulting in orphaned sockets.
To fix this a deinit block must be added to invalidate the session when the client is deallocated
As seen in the screenshot of the initializer a new URLSession is created for every client instance. However because there is no
deinitblock added to the class,session.invalidateAndCancel()is never called when the client is destroyed, resulting in orphaned sockets.To fix this a deinit block must be added to invalidate the session when the client is deallocated