An established connection was aborted by the software in your host machine
<p>Sorry if this is a bit long winded but I thought better to post more than less.  </p>

<p>This is also my First post here, so please forgive.</p>

<p>I have been trying to figure this one out for some time.  and to no avail, hoping there is a genius out there who has encountered this before.  </p>

<p>This is an intermittent problem and has been hard to reproduce.
The code that I am running simply calls a web service
The Web Service call is in a loop (so we could be doing this a lot, 1500 times or more)</p>

<p>Here is the code that is causing the error:</p>

<pre><code>        HttpWebRequest groupRequest = null;
        WebResponse groupResponse = null;            
        try
        {

            XmlDocument doc = new XmlDocument();
            groupRequest = (HttpWebRequest)HttpWebRequest.Create(String.Format(Server.HtmlDecode(Util.GetConfigValue("ImpersonatedSearch.GroupLookupUrl")),userIntranetID));
            groupRequest.Proxy = null;
            groupRequest.KeepAlive = false;
            groupResponse = groupRequest.GetResponse();
            doc.Load(groupResponse.GetResponseStream());
            foreach (XmlElement nameElement in doc.GetElementsByTagName(XML_GROUP_NAME))
            {
                foreach (string domain in _groupDomains )
                {
                    try
                    {
                        string group = new System.Security.Principal.NTAccount(domain, nameElement.InnerText).Translate(typeof(System.Security.Principal.SecurityIdentifier)).Value;
                        impersonationChain.Append(";").Append(group);                            
                        break;
                    }
                    catch{}                        
                }//loop through 

            }

        }
        catch (Exception groupLookupException)
        {
            throw new ApplicationException(String.Format(@"Impersonated Search ERROR:  Could not find groups for user&lt;{0}\{1}&gt;", userNTDomain, userIntranetID), groupLookupException);
        }
        finally
        {
            if ( groupResponse != null )
            {
                groupResponse.Close();
            }
        }
</code></pre>

<p><strong>Here is the error that happens sometimes.</strong></p>

<pre><code>Could not find groups for user&lt;DOMAIN\auser&gt; ---&gt; System.IO.IOException: Unable to read
data from the transport connection: An established connection was aborted by the
software in your host machine. ---&gt; System.Net.Sockets.SocketException: An established  
connection was aborted by the software in your host machine at  
System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags  
socketFlags) at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32  
size) --- End of inner exception stack trace --- at System.Net.ConnectStream.Read(Byte[]  
buffer, Int32 offset, Int32 size) at System.Xml.XmlTextReaderImpl.ReadData() at  
System.Xml.XmlTextReaderImpl.ParseDocumentContent() at  
System.Xml.XmlLoader.LoadDocSequence  
(XmlDocument parentDoc) at System.Xml.XmlDocument.Load(XmlReader reader) at
System.Xml.XmlDocument.Load(Stream inStream) at  
MyWebServices.ImpersonatedSearch.PerformQuery(QueryParameters parameters,  
String userIntranetID, String userNTDomain)--- End of inner exception stack trace  
---at MyWebServices.ImpersonatedSearch.PerformQuery(QueryParameters parameters, String userIntranetID, String userNTDomain)  
--- End of inner exception stack trace ---  
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message,  
WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName,  
Object[] parameters) at MyProgram. MyWebServices.ImpersonatedSearch.PerformQuery  
(QueryParameters parameters, String userIntranetID, String userNTDomain)  
at MyProgram.MyMethod()
</code></pre>

<p>Sorry that was alot of code to read through.<br />
This happens about 30 times out of around 1700</p>

<p>Can anyone help???</p>
