/// <summary>
        /// Envia a requisição.
        /// </summary>
        /// <param name="servicePoint"></param>
        /// <param name="request"></param>
        /// <param name="groupName"></param>
        /// <returns></returns>
        public static EventHandler SendRequest(this System.Net.ServicePoint servicePoint, System.Net.HttpWebRequest request, string groupName)
        {
            object connection;
            object obj2 = servicePoint;

            lock (obj2)
            {
                bool flag2;
                connection = servicePoint.GetConnectionGroup(groupName).GetConnection(request, out flag2);
                if (flag2)
                {
                    servicePoint.SetCurrentConnections(servicePoint.GetCurrentConnections() + 1);
                    if (servicePoint.GetIdleTimer() == null)
                    {
                        var maxIdleTime = servicePoint.GetMaxIdleTime();
                        servicePoint.SetIdleTimer(new System.Threading.Timer(new System.Threading.TimerCallback(servicePoint.GetIdleTimerCallback()), null, maxIdleTime, maxIdleTime));
                    }
                }
            }
            return(WebConnectionExtensions.SendRequest(connection, request));
        }
        /// <summary>
        /// Verifica se possui grupos disponível para reciclar.
        /// </summary>
        /// <param name="servicePoint"></param>
        /// <param name="outIdleSince"></param>
        /// <returns></returns>
        private static bool CheckAvailableForRecycling(this System.Net.ServicePoint servicePoint, out DateTime outIdleSince)
        {
            var      groups = servicePoint.GetGroups();
            TimeSpan span;

            outIdleSince = DateTime.MinValue;
            System.Collections.ArrayList list  = null;
            System.Collections.ArrayList list2 = null;
            object obj2 = servicePoint;

            lock (obj2)
            {
                if ((groups == null) || (groups.Count == 0))
                {
                    servicePoint.SetIdleSince(DateTime.MinValue);
                    return(true);
                }
                span = TimeSpan.FromMilliseconds((double)servicePoint.GetMaxIdleTime());
                list = new System.Collections.ArrayList(groups.Values);
            }
            foreach (var group in list)
            {
                if (group.TryRecycle(span, ref outIdleSince))
                {
                    if (list2 == null)
                    {
                        list2 = new System.Collections.ArrayList();
                    }
                    list2.Add(group);
                }
            }
            object obj3 = servicePoint;

            lock (obj3)
            {
                servicePoint.SetIdleSince(outIdleSince);
                if ((list2 != null) && (groups != null))
                {
                    foreach (var group2 in list2)
                    {
                        if (groups.Contains(WebConnectionGroupExtensions.GetName(group2)))
                        {
                            servicePoint.RemoveConnectionGroup(group2);
                        }
                    }
                }
                if ((groups != null) && (groups.Count == 0))
                {
                    groups = null;
                    servicePoint.SetGroups(null);
                }
                if (groups == null)
                {
                    if (servicePoint.GetIdleTimer() != null)
                    {
                        servicePoint.GetIdleTimer().Dispose();
                        servicePoint.SetIdleTimer(null);
                    }
                    return(true);
                }
                return(false);
            }
        }