Note that there are some explanatory texts on larger screens.

plurals
  1. POFail in release/Adhoc build But work in debug mode (ios)
    primarykey
    data
    text
    <p>Running a sample application in background mode(ios) using TCP sockets.It give message(a local notification ) when client send any message and wait for another message.It works fine when the application run in debugging, but crashes in release mode after 10 seconds. used: xcode 4.2 &amp; iPad 2 for testing..</p> <p>This is the code I'm working with:</p> <pre><code> struct sockaddr_in serv_addr, cli_addr; CFReadStreamRef hReadStream; sockfd = socket(AF_INET, SOCK_STREAM, 0); if (sockfd &lt; 0) printf("Sockfd Error\n"); bzero((char *) &amp;serv_addr, sizeof(serv_addr)); portNo = 3600;//atoi(argv); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = INADDR_ANY; serv_addr.sin_port = htons(portNo); if (bind(sockfd, (struct sockaddr *) &amp;serv_addr, sizeof(serv_addr)) &lt; 0) printf("bind error\n"); listen(sockfd,5); clilen = sizeof(cli_addr); newsockfd = 1; while(newsockfd) { newsockfd = accept(sockfd, (struct sockaddr *) &amp;cli_addr, &amp;clilen); NSLog(@"newsockfd create %d\n",newsockfd); remoteAdd = inet_ntoa(cli_addr.sin_addr); //cout &lt;&lt; remoteAdd &lt;&lt; " port = " &lt;&lt; cli_addr.sin_port &lt;&lt; endl; portNo = cli_addr.sin_port; #if defined(__IPHONE_4_0) &amp;&amp; !(TARGET_IPHONE_SIMULATOR) NSLog(@"newsocket %d\n",newsockfd); // Only do this if it is a SipSocket we are watching if (newsockfd) { // Set it to non-blocking //int set = 0; //ioctl(newsockfd, FIONBIO, reinterpret_cast&lt;int&gt;(&amp;set)); CFStreamCreatePairWithSocket (kCFAllocatorDefault, newsockfd, &amp;hReadStream, NULL); if (CFReadStreamSetProperty(hReadStream, kCFStreamNetworkServiceType, kCFStreamNetworkServiceTypeVoIP) != TRUE) { // An error occured, delete the stream if(hReadStream != NULL) { CFReadStreamClose(hReadStream); CFRelease(hReadStream); hReadStream = NULL; } //return -1; } else NSLog(@" &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; property set Here &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;\n"); if (CFReadStreamOpen(hReadStream) != TRUE) { // An error occured, delete the stream if(hReadStream != NULL) { CFReadStreamClose(hReadStream); CFRelease(hReadStream); hReadStream = NULL; } // return -1; } else NSLog(@"read....\n"); } #endif [self test]; } </code></pre> <p>Crash report in device log :</p> <pre><code>"Application 'Demo' exited abnormally with signal 9: Killed: 9" &amp; "unknown ReportCrash[10915] &lt;Error&gt;: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/servertest_2011-12-13-163920_EyeBalls-iPad.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0" </code></pre> <p>Trying to found the bug but it works fine in debug mode Exactly no error found in device log or debug window..Please help me :(</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload