cfnetwork

NSURLConnection and bound pair of streams (CFStreamCreateBoundPair or CFStreamCreateBoundPairCompat) not working on iPhone 3G

蓝咒 提交于 2019-12-13 05:41:26
问题 I'm using SimpleURLConnections example to implement multipart/form-data POST request using bound pair of streams. It works great in Simulator and on iPhone 3GS/iPhone 4. When I try it on iPhone 3G (running 3.1.3) no data gets sent to the server. NSURLConnection just keeps hanging until it times out. After some testing I figured that the problem only occurs when I write to the producer stream more than once per connection. Whenever I need to write more than once (that is when I have to respond

Device Notification or value change, find it in other device

只愿长相守 提交于 2019-12-11 11:37:11
问题 I'm developing some application which should notify my current device values into other devices within certain area. Let say i'm having app, the same app installed in other 3 devices. When i change something in my device, that should be notified in other device. Like, i'm selecting one button, that button selection should be on other 3 devices too. Is it possible to do without web service and is there any specific frameworks there in iOS to do this task. Its kind of bluetooth searching

CFNetwork Error : The connection failed due to a malformed URL

 ̄綄美尐妖づ 提交于 2019-12-11 09:36:51
问题 While running iphone app, several times i got the following Error The connection failed due to a malformed URL At CFNetwork Error Codes Reference , i got the info that this error triggered by CFNetwork When and Why this error is triggered ? How to get rid from this error? 回答1: NSURLConnection has a method canHandleRequest which will return a boolean whether the url is valid or not, e.g. NSString *strUrl = [NSString stringWithFormat:@"http://test.com/stopBoard/%i",busStopCode]; NSURL *url =

CFHostStartInfoResolution always fail ubunteros

ⅰ亾dé卋堺 提交于 2019-12-11 08:57:38
问题 I have found this nice piece of code to get a hostname from a IP Address. The problem is that it always fail both on simulator and on my 3GS. See below the code, the error is commented within: + (NSArray *)hostnamesForAddress:(NSString *)address { // Get the host reference for the given address. CFStreamError streamError; struct addrinfo hints; struct addrinfo *result = NULL; memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_NUMERICHOST; hints.ai_family = PF_UNSPEC; hints.ai_socktype =

How to fix leak of SocketStream with service type set to VoIP?

倖福魔咒の 提交于 2019-12-11 07:19:58
问题 Xcode reporting SocketStream object is leaking after streams closing. Leak is reliably reproducible on iPhone, but not on Simulator or Mac. Streams are created with CFStreamCreatePairWithSocketToCFHost , then used, closed and released, leaving another SocketStream every time. I checked retain history in Instruments, and found out that every time read and write streams are closed SocketStream has retain count of 2. (my guess is these two retains are done in

WKWebView does not display public Weebly HTML page

烂漫一生 提交于 2019-12-11 04:45:08
问题 Log shows the following upon app launch: CFNetwork internal error (0xc01a:/BuildRoot/Library/Caches/com.apple.xbs/Sources/CFNetwork_Sim/CFNetwork-808.2.16/ProjectRuntime/CFNetworkInternal.h:481) I add a WKWebView programmatically to show a privacy policy stated on a website: - (void) show_Website_Address: (NSString *)theAddress { CGRect newFrame = self.view.frame; newFrame = CGRectMake(self.view.frame.origin.x + 75, newFrame.origin.y, self.view.frame.size.width - 150, newFrame.size.height);

STTwitter CFNetwork internal error NSURLRequest

陌路散爱 提交于 2019-12-10 14:25:56
问题 After looking at this link API mode error I corrected some code using STTwitter. This eradicated one error but made me notice a new CFNetwork error. Whenever I try to fetch statuses using either getHomeTimelineSinceID or getUserTimelinewithScreenName, the error "CFNetwork internal error (0xc01a:/SourceCache/CFNetwork/CFNetwork-695.1.5/Foundation/NSURLRequest.mm:798)" pops up in the debugger. After debugging I found the error pops right after [r Asynchronous] (line 272 of STTwitterAppOnly.m).

Creating and binding socket on Mac OS Hight Sierra

不羁的心 提交于 2019-12-06 07:25:39
问题 I have serious and strange problem with creating socket in my application for Hight Sierra. If I create command Line tool, everything is ok! I create socket, bind socket. But If I trying to create Cocoa App, I can't binding my socket! :( If I use CFSockets in Cocoa App, char punchline[] = "MESSAGE from Server!"; int yes = 1; CFSocketContext CTX = {0, punchline, NULL, NULL, NULL}; CFSocketRef TCPServer = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_STREAM, IPPROTO_TCP,

How can I get the exactly ip address which used to connect in iOS?

ε祈祈猫儿з 提交于 2019-12-06 01:51:44
问题 I created a request using a domain name, e.g., http://www.google.com . But how could I get the exactly ip address which the framework used to connect to the server? I knew that the gethostbyname method or the nslookup method could give us the address, but since the ip address is dynamic allocated, maybe the ip address I request that time is different with these methods returned. So is there a way for me to get the real requested ip address? (I wanted to get the ip programmatically, rather

CFHTTPMessageAddAuthentication fails to add authentication data to request

拥有回忆 提交于 2019-12-05 03:52:03
I'm trying to extend functionality of SocketRocket library. I want to add authentication feature. Since this library is using CFNetwork CFHTTPMessage* API for HTTP functionality (needed to start web socket connection) I'm trying to utilize this API to provide authentication. There is perfectly matching function for that: CFHTTPMessageAddAuthentication , but it doesn't work as I'm expecting (as I understand documentation ). Here is sample of code showing the problem: - (CFHTTPMessageRef)createAuthenticationHandShakeRequest: (CFHTTPMessageRef)chalengeMessage { CFHTTPMessageRef request = [self