getdata = getdata.decode('UTF-8')
print 'getdata is ' + getdata
reqarr = getdata.split('|')
try:
resarr = getattr(self.procclass , reqarr[0])(reqarr[1])
except Exception,e:
sendstr = '1|run has errors:' + str(e)
else:
if resarr[0] == True:
sendstr = '0|' + resarr[1]
else:
sendstr = '1|' + resarr[1]
finally:
if len(sendstr) < 200:
print 'sendstr is ' + sendstr
self.sendresp(sendstr , sock)
except Exception , e:
原文转自:https://mp.weixin.qq.com/s/XMsmK6kaysG7Y_DUZjnx-Q