System.Net.WebConnectionGroup.Close C# (CSharp) Method

Close() public method

public Close ( ) : void
return void
		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 ();
			}
		}

Usage Example

Example #1
0
        public bool CloseConnectionGroup(string connectionGroupName)
        {
            lock (this) {
                WebConnectionGroup cncGroup = GetConnectionGroup(connectionGroupName);
                if (cncGroup != null)
                {
                    cncGroup.Close();
                    return(true);
                }
            }

            return(false);
        }
All Usage Examples Of System.Net.WebConnectionGroup::Close