self.s.listen(5)
except:
print "start CmdReceiver bind or listen failed"
self.inputs = [self.s]
def sendresp(self , info , sock):
data = info[:1024]
leftstr = info[1024:]
while data != '':
sock.send(data)
data = leftstr[:1024]
leftstr = leftstr[1024:]
sock.close()
self.inputs.remove(sock)
def start(self):
ifrun = True
callresult = ""
while ifrun:
原文转自:https://mp.weixin.qq.com/s/XMsmK6kaysG7Y_DUZjnx-Q