Share Pastebin
Guest
Public paste!

soren

By: a guest | Mar 12th, 2010 | Syntax: Python | Size: 0.32 KB | Hits: 51 | Expires: Never
Copy text to clipboard
  1. class Poller(object):
  2.     def __init__(self, targets):
  3.         self.targets = targets
  4.         self.factory = MyClientFactory()
  5.  
  6.     def poll():
  7.         for target in self.targets:
  8.             reactor.connectTCP(target[0], target[1], factory)
  9.  
  10. class MyClientFactory(ClientFactory):
  11.     protocol = DataCollectionProtocol