Hi Garry,
thanks for the watchpoint hint, that explained the loop timings. I've found a separate macOS issue that I believe affects every Objo app that talks to a server on the local network. (We might have to do something slightly differently in Objo, but unfortunately I don't know that yet.)
Symptom
My app connects to a server on the LAN (e.g 192.168.1.16:17178).
- Run from Studio: works.
- Started from Terminal (running the binary directly): works.
- Started by double-click in Finder: fails with "Connection failed: No route to host". The app never shows up in System Settings > Privacy & Security > Local Network, and no permission prompt appears. Setting a custom app name and bundle identifier made no difference.
Cause
it looks like all Objo-built apps appear to share the same main executable UUID (LC_UUID):
$ dwarfdump --uuid jRDCclientTest.app/Contents/MacOS/jRDCclientTest
UUID: 2A39B1A0-F2F9-3BF3-ACAA-4D572C837A11 (arm64)
$ dwarfdump --uuid "Binary Data Download.app/Contents/MacOS/Binary_Data_Download"
UUID: 2A39B1A0-F2F9-3BF3-ACAA-4D572C837A11 (arm64)
(the second one is your "Binary Data Download" example, built unchanged)
macOS Local Network privacy identifies apps by the main executable's UUID. Apple's technote TN3179 "Understanding local network privacy" notes that apps sharing the same main executable UUID confuse the system. The log shows exactly that: the connection is blocked for the UUID, while nehelper reports the app as allowed a few milliseconds later.
(h**ps://developer.apple.com/documentation/Technotes/tn3179-understanding-local-network-privacy?changes=2,2)
log stream --info --predicate 'eventMessage CONTAINS[c] "local network" OR eventMessage CONTAINS[c] "192.168.1.16"'
UserEventAgent: [com.apple.networkextension:] Got local network blocked notification: pid: 50071, uuid: 2A39B1A0-F2F9-3BF3-ACAA-4D572C837A11, bundle_id: (null)
kernel: cfil_inp_log: [50071 jRDCclientTest] TCP out ... faddr ::ffff:192.168.1.16 (port 17178)
nehelper: [com.apple.networkextension:] Local network allowed by preference for jRDCclientTest (com.guido.test)
An earlier run of a different app (jRDCtest1, pid 49279) was blocked with the same UUID, and at that time nehelper reported "allowed by preference for MyApp (com.objo.app.myapp)", i.e. the permission was attributed to another Objo app.
can you please verify?
Workaround for now
Starting the app via a .command file (so it runs as a child of Terminal and inherits Terminal's Local Network permission) works.
Happy to test a fixed build. Thanks!
Best regards,
Guido