def runCallback(self): #while 1: try: data = self.proxy.sock.recv(BUFFER_SIZE) if not data: self.kill() debug("TCP received back data: "+data) try: bundleHandler.handle(self.proxy.sockTo, self.proxy.connFrom, data, self.proxy.forwardBack, self.proxy.forward) except: traceback.print_exc() self.proxy.forwardBack(data) except Exception, err: #print str(err) pass
def runCallback(self): while 1: data = self.proxy.conn.recv(BUFFER_SIZE) if not data: break debug("TCP received data:"+data) try: bundleHandler.handle(self.proxy.connFrom, self.proxy.sockTo, data, self.proxy.forward, self.proxy.forwardBack) except: traceback.print_exc() self.proxy.forward(data) #break #conn.send(data) # echo """self.proxy.closeConnections() self.proxy.sock.send("") self.proxy.sock.close()""" self.kill()