viff

changeset 819:1ed10c3ce40c

Trap ConnectionDone "errors", raise other errors.
author Martin Geisler <mg@daimi.au.dk>
date Sat, 12 Jul 2008 16:12:17 +0200
parents 3543e266d88a
children facc9f1f0bb1
files viff/runtime.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/viff/runtime.py	Sat Jul 12 15:58:56 2008 +0200
     1.2 +++ b/viff/runtime.py	Sat Jul 12 16:12:17 2008 +0200
     1.3 @@ -45,6 +45,7 @@
     1.4  from viff.util import wrapper, rand
     1.5  
     1.6  from twisted.internet import reactor
     1.7 +from twisted.internet.error import ConnectionDone
     1.8  from twisted.internet.defer import Deferred, DeferredList, gatherResults, succeed
     1.9  from twisted.internet.protocol import ClientFactory, ServerFactory
    1.10  from twisted.protocols.basic import Int16StringReceiver
    1.11 @@ -262,7 +263,7 @@
    1.12              self.peer_cert = None
    1.13  
    1.14      def connectionLost(self, reason):
    1.15 -        print "Connection lost:", reason
    1.16 +        reason.trap(ConnectionDone)
    1.17  
    1.18      def stringReceived(self, string):
    1.19          """Called when a share is received.
    1.20 @@ -336,7 +337,7 @@
    1.21              self.protocols_ready.callback(self.runtime)
    1.22  
    1.23      def clientConnectionLost(self, connector, reason):
    1.24 -        print "Client connection lost:", reason
    1.25 +        reason.trap(ConnectionDone)
    1.26  
    1.27      def clientConnectionFailed(self, connector, reason):
    1.28          print "Client connection failed:", reason