When developing server-client software, on the client i call the method
getTrafficDate, but on the server end, i got nio is
None(d2=d.addCallback(lambda object: object.callRemote("getNIOTrafficInfo",
node, nio)))
,so, what's the key point?
Thanks all!
-------------------------------------------------------------------------------------------------------------
client end
def getTrafficDate(self):
if self.interfacenio_dict is not None and self.k:
nodelist = self.interfacenio_dict.keys()
trafficDataList=[]#DeferredList
for node in nodelist:
interfaces=self.interfacenio_dict[node]['interfaceinfo'].keys()
if len(interfaces):
for interface in interfaces:
nio=
self.interfacenio_dict[node]['interfaceinfo'][interface]
if nio is not None:
if 'nio_tap' in nio or 'NIO_NF_tap' in nio:
d=
globals.perspective.callRemote('getServerRoot')
d2=d.addCallback(lambda object:
object.callRemote("getNIOTrafficInfo", node, nio))
d2.addCallback(self.setTrafficSpeed_Tap, node,
interface)
trafficDataList.append(d2)
else:
d=
globals.perspective.callRemote('getServerRoot')
d2=d.addCallback(lambda object:
object.callRemote("getNIOTrafficInfo", node, nio))
d2.addCallback(self.setTrafficSpeed_NotTap,
node, interface)
trafficDataList.append(d2)
trafficDataDeferredList=defer.DeferredList(trafficDataList,
consumeErrors=True)
trafficDataDeferredList.addCallback(self.getTrafficDataHandle)
server end
def remote_getNIOTrafficInfo(self,node,nio):
print nio
if nio.name==nioName:
pass
Bug info is:
File "/home/gddw/Documents/gddw-server-branche/src/Server.py", line 154, in
remote_getNIOTrafficInfo
if nio.name==nioName:
exceptions.AttributeError: 'NoneType' object has no attribute 'name'
_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python