Post

Replies

Boosts

Views

Activity

Reply to ttl returned by DNSServiceQueryRecord() has value 4502 and it never changes.
I think it's a problem because 4502 is the most frequent ttl returned by mDNSResponder and there is no explanation in the documentation as to why this should be. It looks to me like a hard-coded default response. Maybe it is a maximum allowable ttl or indication of some other network error. When I used libresolv (as I presume is used by dig and host) I did not have this issue. I have attached a debug log from my application to FB23574201 which may help.
Jul ’26
Reply to ttl returned by DNSServiceQueryRecord() has value 4502 and it never changes.
That didn't work as expected/hoped for. After flushing the DNS cache (dscacheutil etc..) I checked the kDNSServiceFlagAnsweredFromCache and it does toggle on the second query for the same IP address, indicating a network result for the first query and from the cache in the second case. However in both cases it returns this value of 4502 as the TTL. I was expecting a more reasonable value for the first case where the resolver was clean.
Jul ’26
Reply to ttl returned by DNSServiceQueryRecord() has value 4502 and it never changes.
I am caching the results of the query until the ttl expires. The application is monitoring network traffic and may see several thousand IP addresses in a short time period. I did read the documentation in the header and it seemed to me that the portion quoted only applies when the async operation is left running. If it applies to all queries then maybe it should be the first line in the documentation, but that's quibbling. This strategy worked well when using libresolv. My workaround for now is to cache the result for 300 seconds if I see the specific value of 4502. Thanks for your input.
Jul ’26
Reply to Crash while running NSAlert.runModal
To help clarify the above, the menuWillOpen() function is declared as an AppDelegate:NSMenuDelegate extension. extension AppDelegate: NSMenuDelegate { func menuWillOpen(_ menu: NSMenu) { if menu == myMenu { // enable/disable menu items } } } @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { @IBOutlet weak var myMenu: NSMenu! // NSApplicationDelegate functions }
Topic: UI Frameworks SubTopic: AppKit Tags:
Apr ’26
Reply to Migrating away from SMJobBless
Sorry for the noise. I had forgotten to add '.plist' to the id when running launchctl unload. All fixed now. The root process is started from AuthorizationExecuteWithPrivileges and then a setuid(0) before running launchctl. I know that's frowned upon but hopefully by the time the deprecated call disappears any affected users will have already updated :)
Mar ’26
Reply to XCode connection to local git server via ssh and certificate broken
I had a similar experience, although I did not see the dialog you posted. In my case it was reported as an ssh failure. Like you, I could do a git push from the command line but Xcode was failing. To get it working I edited ~/.ssh/known_hosts and deleted all entries to do with my git server. I then manually logged into the git server (via ssh) and when prompted accepted the connection, adding the keys to known_hosts. Following that Xcode "push" was working again. I have no idea as to why the failure occurred but I am happy that it is working now.
Sep ’24
Reply to IP Address
getifaddrs() will return the IPv4 & IPv6 addresses of each interface. This in most cases, especially for IPv4, will be an address on the users local network. If you're after the users public IP address you will have to use some other method, such as visiting one of the many sites on the internet, via an http(s) request, that will reply with the connecting address.
Jun ’24
Reply to ttl returned by DNSServiceQueryRecord() has value 4502 and it never changes.
I think it's a problem because 4502 is the most frequent ttl returned by mDNSResponder and there is no explanation in the documentation as to why this should be. It looks to me like a hard-coded default response. Maybe it is a maximum allowable ttl or indication of some other network error. When I used libresolv (as I presume is used by dig and host) I did not have this issue. I have attached a debug log from my application to FB23574201 which may help.
Replies
Boosts
Views
Activity
Jul ’26
Reply to ttl returned by DNSServiceQueryRecord() has value 4502 and it never changes.
That didn't work as expected/hoped for. After flushing the DNS cache (dscacheutil etc..) I checked the kDNSServiceFlagAnsweredFromCache and it does toggle on the second query for the same IP address, indicating a network result for the first query and from the cache in the second case. However in both cases it returns this value of 4502 as the TTL. I was expecting a more reasonable value for the first case where the resolver was clean.
Replies
Boosts
Views
Activity
Jul ’26
Reply to ttl returned by DNSServiceQueryRecord() has value 4502 and it never changes.
I am caching the results of the query until the ttl expires. The application is monitoring network traffic and may see several thousand IP addresses in a short time period. I did read the documentation in the header and it seemed to me that the portion quoted only applies when the async operation is left running. If it applies to all queries then maybe it should be the first line in the documentation, but that's quibbling. This strategy worked well when using libresolv. My workaround for now is to cache the result for 300 seconds if I see the specific value of 4502. Thanks for your input.
Replies
Boosts
Views
Activity
Jul ’26
Reply to Crash while running NSAlert.runModal
To help clarify the above, the menuWillOpen() function is declared as an AppDelegate:NSMenuDelegate extension. extension AppDelegate: NSMenuDelegate { func menuWillOpen(_ menu: NSMenu) { if menu == myMenu { // enable/disable menu items } } } @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { @IBOutlet weak var myMenu: NSMenu! // NSApplicationDelegate functions }
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Apr ’26
Reply to Migrating away from SMJobBless
Sorry for the noise. I had forgotten to add '.plist' to the id when running launchctl unload. All fixed now. The root process is started from AuthorizationExecuteWithPrivileges and then a setuid(0) before running launchctl. I know that's frowned upon but hopefully by the time the deprecated call disappears any affected users will have already updated :)
Replies
Boosts
Views
Activity
Mar ’26
Reply to XCode connection to local git server via ssh and certificate broken
I had a similar experience, although I did not see the dialog you posted. In my case it was reported as an ssh failure. Like you, I could do a git push from the command line but Xcode was failing. To get it working I edited ~/.ssh/known_hosts and deleted all entries to do with my git server. I then manually logged into the git server (via ssh) and when prompted accepted the connection, adding the keys to known_hosts. Following that Xcode "push" was working again. I have no idea as to why the failure occurred but I am happy that it is working now.
Replies
Boosts
Views
Activity
Sep ’24
Reply to IP Address
getifaddrs() will return the IPv4 & IPv6 addresses of each interface. This in most cases, especially for IPv4, will be an address on the users local network. If you're after the users public IP address you will have to use some other method, such as visiting one of the many sites on the internet, via an http(s) request, that will reply with the connecting address.
Replies
Boosts
Views
Activity
Jun ’24