Tutorial :How to do long polling from iPhone application?



Question:

I want to create a iPhone chat application and i do not have any experience of socket programming so can u please help me understand How can i do long polling from iPhone application?

Also can NSURLConnection be used for this purpose or we need to use some low level API?

Are there any libraries available for the same?


Solution:1

Check out CocoaAsyncSocket.


Solution:2

Long polling is for languages like javascript that cannot open persistent connections. You can still do long polling with something like NSURLConnection, but you would be much better served by CFStreamCreatePairWithSocketToHost or similar to open a full bidirectional socket.

Long polling is basically a hack that has become a buzzword.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »