cocoa touch - Very odd iPhone - Server problem -


Basically I am sending data from an iPhone app to the Java Socket server, although something strange is not obtained Data until the iPhone application closes! I'm sure I'm missing something but I'm unable to find it, it's pretty weird.

Here's how my connection is made:

  - (CFSocketRef) initSocket {CFSocketContext reference = {.version = 0, .info = self, .retain = NULL, .release = NULL, .copyDescription = NULL}; SOCKETI = CFOSCRECT (KCFLocator default, PFNATET, SOCACRM, IPPRTOOPCP, KCFSXDataCalac ^ KCFSC ConnectCactclubback, Socket Callback, and Present); Uint16_t Port = 4444; Struct sockaddr_in addr4; Membrane (& amp; addr4, 0, size (addr4)); Addr4.sin_family = AF_INET; Addr4.sin_len = sizeof (ADR4); Addr4.sin_port = htons (port); Const char * ipaddress = "192.168.1.5"; Inet_aton (ipaddress, & amp; addr4.sin_addr); NSDTA * Address = [NSDTATA DataWithbites: End Ender 4 Length: Psychophag (ADR4)]; CFSocketError Error = CFSocketConnectToAddress (Socket, (CFDataRef) address, 1); If (error! = KCFSocketSuccess) {Faliure = YES; } And {visible = 2; } CFRunLoopSourceRef source; Source = CFSocketCreateRunLoopSource (zero, socket, 1); CFRunLoopAddSource (CFRunLoopGetCurrent (), source, kCFRunLoopDefaultMode); CFRelease (source); Returning smelly; }  

How this message is sent:

  const char * sendStrUTF = [sentmessage UTF8String]; NSDTA * DataOut = [NSDTATA DataWithbites: Send SRTF Length: Stellen (STERTF)]; CFSocketSendData (socket, tap, (CFDataRef) dataaut, 0);  

Any help would be appreciated!

In advance, oz

I will use those 3 lines wrapping in a performSelectorInBackground / or after a delay combination.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -