PYTHON - Track IP Connections
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/12603383/ip-connection-counting">IP connection counting?</a>  </p>
</blockquote>



<p>I created another topic, but I didn't have a quite good response.
I have a game in python</p>

<p>How to track the IP of someone, and when the IP is connected more than 9 times, self.loseConnection() ?</p>

<p>Something like this:</p>

<pre><code>if self.IpIsConnected(self.ipaddr)&gt;9:
    self.transport.loseConnection()
</code></pre>

<p>Please tell me how to do it! I am a newbie and I don't understand long answers.</p>

<p>EDIT:
My connectionmade code:</p>

<pre><code>    self.address = self.transport.getPeer()
    self.address = [self.address.host]
    print "INTERFACE CONNECTION WITH "+str(self.address[0])+"."


    self.server = self.factory

    if self.server.getConnectedPlayerCount()&gt;50000:
        self.transport.loseConnection()
</code></pre>

<p>The source is in my server.
They connect, then they can login.
I have a connection filtre.
But it just works when the player logins.</p>
