No connection could be made because the target machine actively refused it
<p>First I explain the concept:</p>

<p>I have two system both system have static ip address.</p>

<p>Desktop application developed in vb.net and back end is sql server.</p>

<p>Webapplication is developed in asp.net and backend is sql server.</p>

<p>I run desktop application in system1.
Webapplication run in another system2.</p>

<p>When I send http request from system2 to system1 they response my request.
Sometimes the remote server not connected because port 80 is blocked. That time it display the error message "<i>No connection could be made because the target machine actively refused it</i>".</p>

<p>My Request Coding Example:</p>

<pre><code>    Dim uri1 As New Uri("http://xx.xxx.xx.xx/SysConnectionStatus/")
    If (uri1.Scheme = Uri.UriSchemeHttp) Then
        Dim wrequest1 As HttpWebRequest = HttpWebRequest.Create(uri1)
        wrequest1.Method = WebRequestMethods.Http.Get
        Dim wresponse1 As HttpWebResponse = wrequest1.GetResponse()
        Dim reader1 As New StreamReader(wresponse1.GetResponseStream())
        Dim tmp2 As String = reader1.ReadToEnd()
        wresponse1.Close()
        Response.Write(tmp2)
    End If
</code></pre>

<p>Response for that request is</p>

<pre><code>   ALIVE
</code></pre>

<h2>When I restart my system1 the port 80 is opened. After some request I send then it will be blocked.</h2>

<p>I already check the following things</p>

<pre><code>  1.Windows firewall is disabled.
  2.No antivirus is installed
  3.No virus found in both system.
</code></pre>

<p>So what is the problem? How to solve this problem?</p>
