using System;
using System.IO;
using System.Threading;
+using System.Net;
#if NET_2_0
get {
return stream;
}
+
+ set { stream = value; }
}
internal void WaitUntilComplete ()
if (waitHandle != null)
waitHandle.Set ();
}
- }
-
- internal void SetCompleted (bool synch)
- {
- SetCompleted (synch, null, null);
+ DoCallback ();
}
internal void SetCompleted (bool synch, FtpWebResponse response)
SetCompleted (synch, exc, null);
}
- internal void SetCompleted (bool synch, Stream stream)
- {
- this.synch = synch;
- this.stream = stream;
- lock (locker) {
- completed = true;
- if (waitHandle != null)
- waitHandle.Set ();
- }
- }
-
internal void DoCallback ()
{
- callback (this);
+ if (callback != null)
+ try {
+ callback (this);
+ }
+ catch (Exception) {
+ }
}
// Cleanup resources