def getConfigurations(self):
        '''
        Creates the near and far side configurations, returns near,far
        '''
        configNear = AutoPerformanceConfig()
        configNear.time = self.config.duration
        configNear.frameSize = self.config.frameSize
        configNear.dscp = self.config.dscp
        configNear.numStreams = self.config.numStreams
        configNear.udpRateString = self.config.udpRateString
        configNear.host = self.config.host
        configNear.port = self.config.port+1
        configNear.serverPort = self.config.port+2

        configFar = AutoPerformanceConfig()
        configFar.time = self.config.duration
        configFar.frameSize = self.config.frameSize
        configFar.dscp = self.config.dscp
        configFar.numStreams = self.config.numStreams
        configFar.udpRateString = self.config.udpRateString
        configFar.host = 'lookMeUp' #Get the local IP address on far side
        configFar.port = self.config.port+2 #Get the local port +1
        configFar.serverPort = self.config.port+1
        return configNear,configFar
 def handle(self):
     '''
     Handle the incoming connection
     '''
     configStr = self.request.recv(1024)
     config = AutoPerformanceConfig()
     config.fromString(configStr)
     config.host = self.request.getpeername()[0]
     
     print "Server is using peer name of: ", config.host
     
     engine = AutoPerformanceEngine(config)
     
     #Start our server
     try:
         engine.startServer()
     
     
         runCmd = self.request.recv(10)
         if(str(runCmd) != 'tcp'):
             print "Error: unexpected request. Aborting: recv:", runCmd
             return
         data, summaryTcp = engine.runTcp()
         self.sendTcpResults(data, summaryTcp)
         
         runCmd = self.request.recv(10)
         if(str(runCmd) != 'udp'):
             print "Error: unexpected request. Aborting recv:", runCmd
             return
         summaryUdp = engine.runUdp()
         self.sendUdpResults(summaryUdp)
     
     finally:
         #stop server
         print "Done on server side."
         self.request.close()
         engine.stopServer()
         self.finish()