This works fine when the local network permissions are allowed but not when the permission is denied.
Simply trying to print or set the newConnectionHandler to nil on the listener will result in a crash.
Does anyone know why this happens?
Crash:
Note that we have already added NSLocalNetworkUsageDescription and a NSBonjourServices tcp
We see that we are unable to check the status of the Local Network permissions but maybe there is another way to mitigate getting the crash when trying to clear out our listener.
Simply trying to print or set the newConnectionHandler to nil on the listener will result in a crash.
Does anyone know why this happens?
Crash:
Code Block Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000001, 0x00000001e6cd3234 Termination Signal: Trace/BPT trap: 5 Termination Reason: Namespace SIGNAL, Code 0x5 Terminating Process: exc handler [50016] Triggered by Thread: 0 Thread 0 name: Thread 0 Crashed: 0 libsystem_platform.dylib 0x00000001e6cd3234 _os_unfair_lock_corruption_abort + 36 (lock.c:524) 1 libsystem_platform.dylib 0x00000001e6cd1164 _os_unfair_lock_lock_slow + 320 (lock.c:575) 2 libnetwork.dylib 0x00000001a070e02c nw_listener_set_new_connection_handler + 92 (listener.m:128) 3 (setting newConnectionHandler to nil)
Note that we have already added NSLocalNetworkUsageDescription and a NSBonjourServices tcp
We see that we are unable to check the status of the Local Network permissions but maybe there is another way to mitigate getting the crash when trying to clear out our listener.