iOS-Crash in gethostbyname method

which is mine crash log: It looks like it crashed inside gethostbyName, Do I need to add some special protection when I call gethostbyName?

_sigtramp
libsystem_dnssd.dylib
deliver_request
libsystem_dnssd.dylib
DNSServiceCreateConnection
libsystem_info.dylib
_mdns_search_ex
libsystem_info.dylib
mdns_hostbyname
libsystem_info.dylib
search_host_byname
libsystem_info.dylib
gethostbyname

Before we get into the crash here, what are you looking to do with gethostbyname and why is it being used with CFNetwork APIs (as the tag infers)? More specifically, why are you trying to do that you cannot just connect-by-name instead?

iOS-Crash in gethostbyname method
 
 
Q