Skip to content

Instantly share code, notes, and snippets.

from twisted.internet import reactor, protocol
from twisted.python import log
class BlockingProtocol(protocol.Protocol):
connection_count = 0
def connectionMade(self):
log.msg('new connection(%d connection has been made)' % self.connection_count)
BlockingProtocol.connection_count += 1