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: [email protected]
ReportedBy: [EMAIL PROTECTED]
QAContact: [email protected]
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 ([EMAIL PROTECTED])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.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs