cfnetwork

Are there more sophisticated alternatives to Apples Reachability class?

安稳与你 提交于 2019-11-29 08:00:44
Apple has created that famous Reachability class but looking at the code I don't trust it much. The formatting and header is messy. Also it provides no help for showing that "You have no internet!" alert. I just want to do: At some point download a XML. When there is no internet, show alert. When internet disconnects while downloading the XML, show alert. In my app the user taps no download button it all happens automatically in the background. That's it. Really. I spent now 3 hours with Reachability my brain just rejects it. Did someone create a clever alternative with a clean header and

How To Monitor Network Activity From Within App?

我的未来我决定 提交于 2019-11-28 19:23:31
问题 I'm trying to monitor network activity on my iPhone from within an app I'm developing. Does iOS support a netstat-like command or something similar that can tell me what what inbound and outbound connections are active ? 回答1: After some searching I found Apple's code used for netstat. Everything you need in the void protopr(uint32_t proto, char *name, int af) function. I tested on the device and sysctlbyname("net.inet.tcp.pcblist_n",...) works. That should be all you need. 回答2: I can't test

A list of linking CFNetwork version numbers to the version of iOS

回眸只為那壹抹淺笑 提交于 2019-11-28 15:51:38
问题 I'm wondering if anyone has a list of linking CFNetwork version numbers to the version of iOS? I've found the list for OSX CFNetwork versions but it's quite old. 回答1: I made this list from some of the devices I had around at the time. It's not complete but hopefully it is helpful for someone else. Device OS CFNetwork Version iPod Touch 2G 3.1.3 CFNetwork/459 Darwin/10.0.0d3 iPod Touch 3G 4.0 CFNetwork/485.2 Darwin/10.3.1 iPhone 3GS 4.1 CFNetwork/485.10.2 Darwin/? iPhone 3G 4.2.1 CFNetwork/485

How could I curl for a request with headers in shell scripting

妖精的绣舞 提交于 2019-11-28 09:58:27
问题 I tried to execute a CURL statement as follows, for which I am getting required response: curl -s -POST --header 'Content-Type: application/json' 'http://www.dummy.com/projectname/page_relevance' -d '{"query": "q_string", "results": [{"abstract": "abs_string", "title": "title_string"}, "mode": "value", "cache": true, "source": "value"}' But when i tried to pass variable values to parameter "query", the curl statement mentioned below not works and observed some error statement in response:

Are there more sophisticated alternatives to Apples Reachability class?

冷暖自知 提交于 2019-11-28 01:36:24
问题 Apple has created that famous Reachability class but looking at the code I don't trust it much. The formatting and header is messy. Also it provides no help for showing that "You have no internet!" alert. I just want to do: At some point download a XML. When there is no internet, show alert. When internet disconnects while downloading the XML, show alert. In my app the user taps no download button it all happens automatically in the background. That's it. Really. I spent now 3 hours with

How to handle “CFNetwork SSLHandshake failed” in iOS

非 Y 不嫁゛ 提交于 2019-11-27 14:33:56
Some times i'm getting CFNetwork SSLHandshake failed -(9806) in my code,but i'm not sure why this is happening as my code runs smoothly,except when i run it in iOS 6 and then on iOS 7 64-bit i get this warning. Can anybody suggest me, how to handle this issue ? Normally when I get CFNetwork SSLHandshake failed -(*) Its because of my local wifi network (device is connected to network but not the internet) Try it again on another network (3G is the quickest solution for me) Antoine This could also happen because of iOS 9. iOS 9 and OSX 10.11 require TLSv1.2 SSL for all hosts you plan to request

What is the biggest difference between NSURLConnection and NSURLSession

隐身守侯 提交于 2019-11-27 11:56:45
NSURLSession is new network SDK than NSURLConnection from Apple. 3rd old choice is CFNetwork. Question here is to figure out the biggest difference between them to understand why Apple is evolving like these. Thanks The entire model is different. NSURLSession is designed around the assumption that you'll have a lot of requests that need similar configuration (standard sets of headers, etc.), and makes life much easier if you do. NSURLSession also provides support for background downloads, which make it possible to continue downloading resources while your app isn't running (or when it is in

How can I figure out which URL is being blocked by App Transport Security?

大城市里の小女人 提交于 2019-11-27 11:13:17
I'm upgrading an iOS app to iOS 9, and I have some URLs that are not secure, and I need a few exceptions to App Transport Security. I've added the two that I know about, but there are some warnings happening now stating: App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file. I need to know what URLs are being blocked so I can add them to the Info.plist, they're probably images or media files. How can I make the system log the URLs it decided not to load? Micah Hainline Editor Note

CFNetwork and Bonjour integration for iPhone to Mac integration

大憨熊 提交于 2019-11-26 23:29:08
I want to use CFNetwork and Bonjour in conjunction to be able to have communications between my iPhone app and a Mac app. The app on the iPhone would have one button. Then on the Mac app, there will be a label. If the button is pushed on the iPhone app, the label changes on the Mac app. Is there example code out there that can do this? If not, can someone lead me in the right direction? Thanks! Brad Larson Bill Dudney created a sample iPhone Bonjour application to demonstrate how to use Bonjour to discover and connect to two iPhones. I ported this example to the Mac to demonstrate how to do

dyld: Symbol not found: _NSURLAuthenticationMethodClientCertificate when trying to run iOS app

微笑、不失礼 提交于 2019-11-26 20:04:42
My app is crashing with the message: dyld: Symbol not found: _NSURLAuthenticationMethodClientCertificate Referenced from: /var/mobile/Applications/C7B596AD-FB09-4685-BDFC-7E955A5DD185/IRON TRAINERS.app/IRON TRAINERS Expected in: /System/Library/Frameworks/CFNetwork.framework/CFNetwork in /var/mobile/Applications/C7B596AD-FB09-4685-BDFC-7E955A5DD185/IRON TRAINERS.app/IRON TRAINERS (lldb) when I try to build and Run. When I remove the CFNetwork from my project, it works, I don't know why. I just installed Xcode6Beta and opened my project. It was working fine on Xcode5.1. UPDATE: It works fine on