[Mono-bugs] [Bug 429200] New: Cannot re-call start of asynchronous method... Error
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Tue Sep 23 11:46:50 EDT 2008
https://bugzilla.novell.com/show_bug.cgi?id=429200
Summary: Cannot re-call start of asynchronous method... Error
Product: Mono: Class Libraries
Version: 2.0
Platform: All
OS/Version: Windows XP
Status: NEW
Severity: Normal
Priority: P5 - None
Component: System
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: andrew at coupesonline.com
QAContact: mono-bugs at lists.ximian.com
Found By: DeveloperNet
Description of Problem:
System.InvalidOperationException: Cannot re-call start of asynchronous method
while a previous call is still in progress. Error occurs when:
System.Net.HttpWebRequest.BeginGetRequestStream (System.AsyncCallback
callback, System.Object state) [0x00000]
at System.Net.HttpWebRequest.GetRequestStream ()
The code shown below has been running perfectly for months under Net 2.0.
The code uploads a file to a web service using the REST framework. The REST
libs are well tested and work fine under Mono - except when I upload a file
using the code below.
int bytesRead = 0;
while ((bytesRead = bufferedInput.Read(buf, 0, 1024)) > 0)
{
contentLength += bytesRead;
request.GetRequestStream().Write( buf, 0, bytesRead );
}
request.GetRequestStream().Close();
Robert Jordan (robertj at gmx.net)suggested following work around, which worked.
Stream reqStm = request.GetRequestStream();
int bytesRead = 0;
while ((bytesRead = bufferedInput.Read(buf, 0, 1024)) > 0)
{
contentLength += bytesRead;
reqStm.Write( buf, 0, bytesRead );
}
reqStm.Close();
Steps to reproduce the problem:
1.
2.
Actual Results:
Expected Results:
How often does this happen?
Additional Information:
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list