/rev/7eb99c27a46e
changeset: 1210:7eb99c27a46e
user: Marcel Keller <[email protected]>
date: Thu Sep 10 18:45:15 2009 +0200
summary: Don't output the amount of transferred data when connection closed
(interference with trial).
diffstat:
viff/runtime.py | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diffs (44 lines):
diff -r ec281b1151e1 -r 7eb99c27a46e viff/runtime.py
--- a/viff/runtime.py Thu Sep 10 18:41:07 2009 +0200
+++ b/viff/runtime.py Thu Sep 10 18:45:15 2009 +0200
@@ -296,8 +296,6 @@
self.sendString(str(self.factory.runtime.id))
def connectionLost(self, reason):
- print "Transfer to peer %d: %d bytes in %d packets" % \
- (self.peer_id, self.sent_bytes, self.sent_packets)
reason.trap(ConnectionDone)
self.lost_connection.callback(self)
@@ -586,7 +584,7 @@
def close_connections(_):
print "done."
- print "Closing connections..."
+ print "Closing connections...",
results = [maybeDeferred(self.port.stopListening)]
for protocol in self.protocols.itervalues():
results.append(protocol.lost_connection)
@@ -594,7 +592,7 @@
return DeferredList(results)
def stop_reactor(_):
- print "Connections closed."
+ print "done."
print "Stopping reactor...",
reactor.stop()
print "done."
@@ -870,6 +868,13 @@
self.depth_counter -= 1
self.activation_counter = 0
+ def print_transferred_data():
+ """Print the amount of transferred data for all connections."""
+
+ for protocol in self.protocols.itervalues():
+ print "Transfer to peer %d: %d bytes in %d packets" % \
+ (protocol.peer_id, protocol.sent_bytes,
protocol.sent_packets)
+
def make_runtime_class(runtime_class=None, mixins=None):
"""Creates a new runtime class with *runtime_class* as a base
_______________________________________________
viff-commits mailing list
[email protected]
http://lists.viff.dk/listinfo.cgi/viff-commits-viff.dk