Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-25-2012, 10:48 AM   #1 (permalink)
Registered Member
 
Join Date: Jan 2012
Posts: 2
digitalcassette is on a distinguished road
Unhappy Multiple NSURLConnections Question

I'm using an async NSURLConnection wrapper to make calls to my server. I'm using long-polling techniques to make a realtime response from another user happen as quickly as possible.

However I'm running into an issue regarding multiple connections that I can't quite solve.

With the nature of the server communication I can't just kill the NSURLConnection and expect all connected parties to act gracefully. So what I'm doing instead is using a seperate 2nd instance NSURLConnection to call up to the server and call a necessary method to terminate the 1st instance Connection. This works great on the first try. The 2nd try seems to act completely differently.

Here's how it looks in my log:
1. Connection 1 : Initiate Call 1
2. Call 1 Waiting on server Response
3. Connection 2 : Initiate Cancel for Call 1
4. Connection 1 : Responds with "Cancelled by User"
5. Connection 2 : Responds with "Success"
(now do it again)
6. Connection 1 : Initiate Call 2
7. Call 2 Waiting on server Response
8. Connection 2 : Initiate Cancel for Call 2
(nothing happens... next until a timeout occurs)

My server logs show zero activity from step 8. It looks as though the application is having trouble with too many connections and Step 8 literally waits on Step 6/7 to finish.

What am I doing wrong here?!?!?!?! I can't see it being an issue on the server because my Android client that's calling the same methods doesn't encounter this problem. This is something I've done on everything except for ios and for some reason the connectivity just isn't working the way I expect.
digitalcassette is offline   Reply With Quote
Old 01-26-2012, 10:11 AM   #2 (permalink)
Registered Member
 
Join Date: Jan 2012
Posts: 2
digitalcassette is on a distinguished road
Default

(erasing what I thought was the answer)

Last edited by digitalcassette; 01-26-2012 at 10:23 AM.
digitalcassette is offline   Reply With Quote
Reply

Bookmarks

Tags
ios nsurlconnection

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 393
11 members and 382 guests
Atatator, condor304, FrankWeller, glenn_sayers, iphonedevshani, MAMN84, mraalex, PowerGoofy, QuantumDoja, tim0504, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,674
Threads: 94,123
Posts: 402,908
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Atatator
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:52 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0