How to do long polling from iPhone application?
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?
Check out CocoaAsyncSocket.
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.
精彩评论