internal void SetWriteStreamError (WebExceptionStatus status, Exception exc)
{
if (Aborted)
return;
WebAsyncResult r = asyncWrite;
if (r == null)
r = asyncRead;
if (r != null) {
string msg;
WebException wex;
if (exc == null) {
msg = "Error: " + status;
wex = new WebException (msg, status);
} else {
msg = String.Format ("Error: {0} ({1})", status, exc.Message);
wex = new WebException (msg, exc, status);
}
r.SetCompleted (false, wex);
r.DoCallback ();
}
}