X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=python%2Fovstest%2Ftcp.py;h=8413343f6f8c1e234147bb157a52ac6a49c3b8d3;hb=47284b1fc6fe84a9b5b43b49bef868e4eb230cd1;hp=33dc7192f464bd1711ae6f4aa1b917bb8f4d2ddf;hpb=0be6140a9a7de46f07e09d3ba200bd7f0cf73838;p=openvswitch diff --git a/python/ovstest/tcp.py b/python/ovstest/tcp.py index 33dc7192..8413343f 100644 --- a/python/ovstest/tcp.py +++ b/python/ovstest/tcp.py @@ -1,4 +1,4 @@ -# Copyright (c) 2011 Nicira Networks +# Copyright (c) 2011, 2012 Nicira Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,14 +29,10 @@ class TcpListenerConnection(Protocol): def __init__(self): self.stats = 0 - def connectionMade(self): - print "Started TCP Listener connection" - def dataReceived(self, data): self.stats += len(data) def connectionLost(self, reason): - print "Stopped TCP Listener connection" self.factory.stats += self.stats @@ -50,16 +46,10 @@ class TcpListenerFactory(Factory): def __init__(self): self.stats = 0 - def startFactory(self): - print "Starting TCP listener factory" - - def stopFactory(self): - print "Stopping TCP listener factory" - def getResults(self): """ returns the number of bytes received as string""" - #XML RPC does not support 64bit int (http://bugs.python.org/issue2985) - #so we have to convert the amount of bytes into a string + # XML RPC does not support 64bit int (http://bugs.python.org/issue2985) + # so we have to convert the amount of bytes into a string return str(self.stats) @@ -104,18 +94,13 @@ class TcpSenderConnection(Protocol): """ def connectionMade(self): - print "Started TCP sender connection" producer = Producer(self, self.factory.duration) self.transport.registerProducer(producer, True) producer.resumeProducing() def dataReceived(self, data): - print "Sender received data!", data self.transport.loseConnection() - def connectionLost(self, reason): - print "Stopped TCP sender connection" - class TcpSenderFactory(ClientFactory): """ @@ -128,12 +113,6 @@ class TcpSenderFactory(ClientFactory): self.duration = duration self.stats = 0 - def startFactory(self): - print "Starting TCP sender factory" - - def stopFactory(self): - print "Stopping TCP sender factory" - def getResults(self): """Returns amount of bytes sent to the Listener (as a string)""" return str(self.stats)