+2009-12-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
+
+ * WebConnectionGroup.cs:
+ * ServicePoint.cs: implemented CloseConnectionGroup().
+
2009-12-04 Sebastien Pouliot <sebastien@ximian.com>
* System.Net/DnsEndPoint.cs: Moved from System.Net (where the
}
#endif
#if NET_2_0
- [MonoNotSupported ("")]
public bool CloseConnectionGroup (string connectionGroupName)
{
- throw new NotImplementedException ();
+ lock (locker) {
+ WebConnectionGroup cncGroup = GetConnectionGroup (connectionGroupName);
+ if (cncGroup != null) {
+ cncGroup.Close ();
+ return true;
+ }
+ }
+
+ return false;
}
#endif
queue = new Queue ();
}
+ public void Close ()
+ {
+ //TODO: what do we do with the queue? Empty it out and abort the requests?
+ //TODO: abort requests or wait for them to finish
+ lock (connections) {
+ WeakReference cncRef = null;
+
+ int end = connections.Count;
+ ArrayList removed = null;
+ for (int i = 0; i < end; i++) {
+ cncRef = (WeakReference) connections [i];
+ WebConnection cnc = cncRef.Target as WebConnection;
+ if (cnc != null) {
+ cnc.Close (false);
+ }
+ }
+ connections.Clear ();
+ }
+ }
+
public WebConnection GetConnection (HttpWebRequest request)
{
WebConnection cnc = null;