3

this is the procedure of requirement.

1) I make a request, which will make a connection. It might break, but should be notified to programmer by callback.

2) the data comes as a stream from endless page in chunks.

3) I want suggestion because normal NSURLConnection wont be handy as it will break in no time. Input here is endless page from which stream comes.

Note: Endless stream might be empty and asynchronous. Any suggestions?

Thanks in advance.

Venkatarao N
  • 245
  • 3
  • 14
  • "it will break in no time". Explain this please. NSURLConnection should work fine with a chunked-encoded stream. – Mike Weller Jun 11 '12 at 07:08
  • I mean, lets say I am not getting data for 10 mins, it will stop getting. Sorry, if I am wrong. But my stream input might be empty, but whenever data is available it(connection) should get that chunk. – Venkatarao N Jun 11 '12 at 07:19

1 Answers1

2

If your only problem is the timeout associated with NSURLConnection, you can change that timeout as described in this question.

Otherwise, you will have to write your own NSStream-based implementation. See this documentation for more information.

Community
  • 1
  • 1
Mike Weller
  • 45,401
  • 15
  • 131
  • 151
  • For such streams host is of the format **`http:www.google.com`** and port 80. But for me url is **`http:website.com:30/events?after=1002929`**. How to handle this? Thanks. – Venkatarao N Jun 12 '12 at 06:58
  • @Mike Weller i want to maintain a persistent channel with http server, Do i need to use NSStream , can you please give any example based on post request? or what do you suggest. i am very new to this IOS development. Please guide me – Amith Jul 09 '15 at 05:12