title: ServiceStack throws StackOverflowException when receiving large data
body: <p>I am using ServiceStack's JsonServiceClient with Silverlight 5 to receive JSON data from my ASP.Net server. It works perfectly for short JSON strings but when it comes to very large amounts of data, a StackOverflowException is thrown in <code>ServiceStack.ServiceClient.Web.AsyncServiceClient.ReadCallBack&lt;&gt;</code>. </p>
  
  <p>So I examined the latest source code on <a href="https://github.com/ServiceStack/ServiceStack/blob/master/src/ServiceStack.Common/ServiceClient.Web/AsyncServiceClient.cs#L495" rel="nofollow">GitHub</a> and noticed that the data is read block-wise from a stream as chunks of <a href="https://github.com/ServiceStack/ServiceStack/blob/master/src/ServiceStack.Common/ServiceClient.Web/AsyncServiceClient.cs#L47" rel="nofollow">4096 bytes</a>. The problem is that this method reads a block and tells the stream to call itself recursively when done. The more data we receive, the more recursive calls occur. That's why the application crashes when the received data is too large.</p>
  
  <p>Ideas: </p>
  
  <ul>
  <li>Refactor the method to be iterative rather than recursive. Seems like a hard task to do with all these conditional returns, awaits, try-catch and such.</li>
  <li>Increase the block size. I don't know if there are any reasons for 4096
  here, so I'd rather not do this alone.</li>
  </ul>
  
  <p>Anyway, before I download all the source code, modify and compile it myself, I'd like to hear your opinion on this. Is it a bug or am I using it wrong?</p>