Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

ModernHTTPClient - The underlying NSMutableData changed while we were consuming data

$
0
0

I started using ModernHTTPClient to test whether it improved the performance of my app. The component description claims:

"Write your app using System.Net.Http, but drop this library in and it will go drastically faster."

About once in every 20 or 30 HTTP requests it throws this exception. It's very intermittent. Anyone have any ideas? The method is asynchronous, so I'm wondering if it has something to do with that.

System.InvalidOperationException: The underlying NSMutableData changed while we were consuming data
  at MonoTouch.Foundation.NSData+UnmanagedMemoryStreamWithMutableRef.InvalidOperation () [0x00000] in /Developer/MonoTouch/Source/maccore/src/Foundation/NSData.cs:164
  at MonoTouch.Foundation.NSData+UnmanagedMemoryStreamWithMutableRef.Read (System.Byte[] buffer, Int32 offset, Int32 count) [0x0001b] in /Developer/MonoTouch/Source/maccore/src/Foundation/NSData.cs:170
  at --- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62
  at System.Runtime.CompilerServices.TaskAwaiter`1[System.Int32].GetResult () [0x00034] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter_T.cs:59
  at ModernHttpClient.ConcatenatingStream+<ReadAsync>c__async1.MoveNext () [0x00000] in <filename unknown>:0
  at --- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[System.Int32].GetResult () [0x00034] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/ConfiguredTaskAwaitable_T.cs:62
  at System.IO.Stream+<CopyToAsync>c__async0.MoveNext () [0x00095] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.IO/Stream.cs:306
  at --- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00034] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/ConfiguredTaskAwaitable.cs:62
  at System.Net.Http.HttpContent+<LoadIntoBufferAsync>c__async1.MoveNext () [0x00072] in /Developer/MonoTouch/Source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpContent.cs:134
  at --- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00034] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/ConfiguredTaskAwaitable.cs:62
  at System.Net.Http.HttpClient+<SendAsyncWorker>c__async0.MoveNext () [0x00137] in /Developer/MonoTouch/Source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs:281
  at --- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[System.Net.Http.HttpResponseMessage].GetResult () [0x00034] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/ConfiguredTaskAwaitable_T.cs:62
  at System.Net.Http.HttpClient+<GetStringAsync>c__async5.MoveNext () [0x00027] in /Developer/MonoTouch/Source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs:320
  at --- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62
  at System.Runtime.CompilerServices.TaskAwaiter`1[System.String].GetResult () [0x00034] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter_T.cs:59
  at Mangazine.DownloadManager+<DownloadJsonIssueDataAsync>c__async0.MoveNext () [0x000a3] in /Users/richard/Projects/mangazine-client/Mangazine/Helper Classes/DownloadManager.cs:27
  at --- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62
  at System.Runtime.CompilerServices.TaskAwaiter`1[System.Json.JsonArray].GetResult () [0x00034] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter_T.cs:59
  at Mangazine.MangazineViewController+<SetupIssueTables>c__async0.MoveNext () [0x00207] in /Users/richard/Projects/mangazine-client/Mangazine/ViewControllers/MangazineViewController.cs:67

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>