[mono-android] Copy from a file stream to another file stream interruped by 'INTERRUPTION_REQUESTED_HANDLE'
klimaye
klimaye at gmail.com
Fri Jun 15 15:00:16 UTC 2012
We are seeing the log below when a stream to stream copy is occurring over
the wireless.
The stream copy works fine for file size less than 10 mb. The file copy in
question is a 12 mb file.
It looks like the issue is happening in the framework level code.
Any pointers/help/workarounds would be great
Thanks
-----Code---------
public static void CopyStreamTo(this Stream input, Stream output)
{
//use 32kb blocks
byte[] buffer = new byte[32 * 1024];
int len;
var streamLength = input.Length;
Android.Util.Log.Info("app", string.Format("total input stream
length = {0}", streamLength));
output.SetLength(streamLength);
int counter = 0;
while ((len = input.Read(buffer, 0, buffer.Length)) > 0)
{
if (counter % 23 == 0)
Android.Util.Log.Info("app", string.Format("still
copying from stream to stream {0}", counter));
output.Write(buffer, 0, len);
counter++;
}
}
----------------Log-----------
06-14 17:28:39.320 I/sssvida ( 3072): total input stream length = 12496896
..
..
06-14 17:28:42.930 I/app( 3072): still copying from stream to stream 1196
06-14 17:28:42.940 F/ ( 3072): * Assertion at
/Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/mono/mono/io-layer/wthreads.c:1343,
condition `prev_handle == INTERRUPTION_REQUESTED_HANDLE' not met
06-14 17:28:42.940 I/mono ( 3072): Stacktrace:
06-14 17:28:42.940 I/mono ( 3072):
06-14 17:28:42.940 I/mono ( 3072): at System.Threading.Monitor.TryEnter
(object,int,bool&) <IL 0x00044, 0x001e3>
06-14 17:28:42.940 I/mono ( 3072): at System.Threading.Monitor.Enter
(object,bool&) <IL 0x00003, 0x00053>
06-14 17:28:42.940 I/mono ( 3072): at
System.Net.WebAsyncResult.get_IsCompleted () <IL 0x0000c, 0x000b7>
06-14 17:28:42.940 I/mono ( 3072): at
System.Net.WebConnectionStream.EndRead (System.IAsyncResult) <IL 0x00030,
0x0023b>
06-14 17:28:42.940 I/mono ( 3072): at
System.Net.WebConnectionStream.ReadCallbackWrapper (System.IAsyncResult) <IL
0x0002b, 0x0019b>
06-14 17:28:42.940 I/mono ( 3072): at System.Net.WebAsyncResult.CB
(object) <IL 0x00007, 0x0005f>
06-14 17:28:42.940 I/mono ( 3072): at (wrapper runtime-invoke)
<Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr)
<IL 0x00052, 0xffffffff>
--
View this message in context: http://mono-for-android.1047100.n5.nabble.com/Copy-from-a-file-stream-to-another-file-stream-interruped-by-INTERRUPTION-REQUESTED-HANDLE-tp5710364.html
Sent from the Mono for Android mailing list archive at Nabble.com.
More information about the Monodroid
mailing list