daily pastebin goal
31%
SHARE
TWEET

Untitled

felipeo Jun 26th, 2011 217 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     def poemReceived(self, poem):
  2.         try:
  3.             self.killer.cancel()
  4.             print "Survived the timeout."
  5.         except AlreadyCalled: # imported from twisted.internet.error
  6.             # It was the killer that caused this call.
  7.             print "Death by timeout"
  8.         self.factory.poem_finished(poem)
  9.  
  10.     def makeConnection(self, tcp):
  11.         print "Connection made"
  12.         from twisted.internet import reactor
  13.         self.killer = reactor.callLater(self.factory.timeout,
  14.                                         tcp.loseConnection)
  15.         Protocol.makeConnection(self,tcp)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top