ios - To close NSStream objects before resigning active -


i have nsinputstream , nsoutputstream scheduled in non-main-thread run loop. i'm using cfstreamcreatepairwithsockettohost. remote endpoint external device communicates app tcp on wifi.

when applicationwillresignactive called, want close these. want guaranteed close, because app may want communicate same device, , device accepts 1 tcp connection.

additional information:

it frequent occurrence in context of device multiple apps may need communicate device.

i have tried using performselector:onthread:withobject:waituntildone: (with waituntildone:yes) in applicationwillresignactive. doesn't work, , in cases seems selector not called.

my understanding can't close nsstream objects or destroy task queue main thread.

i can not change how device receives connections. listens on 1 address/port tcp connections, , allows 1 connection (it doesn't multiplex connections source port).

use dispatch_sync() background queue.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -