SocketException (0x274c)
<p>I used html agility pack to implement one site_search module. It worked in the local machine. Then uploaded to server and while debugging in the server(as localhost while debugging through remote desktop) it worked fine . But failed to connect while accessing it through IP address of server. It shows the error in code </p>

<p>"
Dim webGet = New HtmlWeb
Dim document = webGet.Load(baseUrl)
"</p>

<p>The Error details are</p>

<p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.</p>

<p>Exception Details: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond</p>

<p>Source Error:</p>

<p>Line 37: 
Line 38:         Dim webGet = New HtmlWeb
<strong>Line 39:         Dim document = webGet.Load(baseUrl)</strong>
Line 40:         For Each link As HtmlNode In document.DocumentNode.SelectNodes("//a[@href]")
Line 41:             Dim att As HtmlAttribute = link.Attributes("href")</p>

<p>Stack Trace:</p>

<p>[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +239
   System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +35
   System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket&amp; socket, IPAddress&amp; address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception&amp; exception) +224</p>

<p>[WebException: Unable to connect to the remote server]
   System.Net.HttpWebRequest.GetResponse() +5386653
   HtmlAgilityPack.HtmlWeb.Get(Uri uri, String method, String path, HtmlDocument doc, IWebProxy proxy, ICredentials creds) +826
   HtmlAgilityPack.HtmlWeb.LoadUrl(Uri uri, String method, WebProxy proxy, NetworkCredential creds) +59
   HtmlAgilityPack.HtmlWeb.Load(String url, String method) +96
   HtmlAgilityPack.HtmlWeb.Load(String url) +11
   AdminSiteIndex.btnIndex_Click(Object sender, EventArgs e) in C:\inetpub\wwwroot\TCIPLWEB\AdminSiteIndex.aspx.vb:39
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565</p>

<p>Version Information: Microsoft .NET Framework Version:2.0.50727.5448; ASP.NET Version:2.0.50727.5420 </p>

<p>Please help me with your valuable comments.</p>
