title: No connection could be made because the target machine actively refused it - Socket Program
body: <p>The problem that im facing is given in the Headline. 
  This is where i am :</p>
  
  <ul>
  <li><p>Got a Socket Server up and running on Port 61911 :</p>
  
  <p>_server.Bind(new IPEndPoint(IPAddress.Any, 61911));</p></li>
  <li><p>And that port (61911) is opened globally and set the Server IP Address to 192.168.1.2 (My PC)</p></li>
  <li><p>Firewall and Antivirus Programs are dealed well.</p></li>
  <li><p>Ran the Socket Server and got port open status from <a href="http://www.yougetsignal.com/tools/open-ports/" rel="nofollow">YouGetSignal.com</a></p></li>
  </ul>
  
  <p>Pic :</p>
  
  <p><a href="http://img189.imageshack.us/img189/1777/x07w.png" rel="nofollow">http://img189.imageshack.us/img189/1777/x07w.png</a></p>
  
  <ul>
  <li><p>And while ^Checking, the Socket Server responded well, i <strong>think</strong> that means <strong>Established</strong> Connection to the Server im hosting.</p></li>
  <li><p>But when accessed through the Client, i get the error specified 
  'No Connection could be made...' </p></li>
  </ul>
  
  <p>Here is the Code that I use for Connection in Client :</p>
  
  <pre><code>private static void LoopConnect()
      {
          while (!_client.Connected)
          {
              try
              {
  
                  IPAddress ip = IPAddress.Parse("**PUBLIC IP**");
                  IPEndPoint remoteEP = new IPEndPoint(ip,61911);
                  _client.Connect(remoteEP);
              }
              catch (SocketException e) { Console.WriteLine(e.Message); }
          }
  
          Console.WriteLine("Connected!");
      }
  </code></pre>
  
  <p>And this Code that handles Accepting in the Server :</p>
  
  <pre><code>private static void SetupServer()
      {
          Console.WriteLine("Setting up Server.. ");
          _server.Bind(new IPEndPoint(IPAddress.Any, 61911));
          _server.Listen(4);
          Console.WriteLine("Server UP!");
          _server.BeginAccept(new AsyncCallback(AcceptCallBack), null);
      }
  
      private static void AcceptCallBack(IAsyncResult AR)
      {
          Socket socket = _server.EndAccept(AR);
          _clients.Add(socket);
          socket.BeginReceive(_buffer, 0, _buffer.Length, SocketFlags.None, new AsyncCallback(ReceiveCallback), socket);
          _server.BeginAccept(new AsyncCallback(AcceptCallBack), null);
      }
  </code></pre>
  
  <p>So i think thats all the information regarding the problem i can give ..</p>
  
  <p>*Evrything regarding Malware Protection, Firewalls, Port Forwarding.. is done.
  *And port is open in <code>netstat -anb</code></p>
  
  <p>Solutions appreciated :)</p>
  
  <p>EDIT : The client sends request and then the server acknowledges. But i think that doesnt reach the client. For which i should do something else in the router like porting from 'inside'. How is that possible ???</p>