On Tue, Feb 17, 2009 at 11:08:12AM +0000, <Francesco Losciale>:
~> Hi for all,
~> i'm having some trouble reading RPC stuff, i have reached the following
~> There's something that is confusing me, at this line
~> 
~> 275 radar.py: if self.ntk_client[ip].connected:
~> 
~> NtkNode has no attribute 'connected'.

In order to understand the code, the best strategy  is to check the various 
test/*.py.

In test_rpc.py the fundamentals steps are:

        rpc.TCPServer(mod, ('localhost', PORT))

        client = rpc.TCPClient(port=PORT)

        xsquare = client.square(x)

where `mod' is the instance of the class MyMod, which has some 
`remotable_funcs'.

In run() of ntkd.py we have:

        rpc.MicroTCPServer(self, ('', 269), None, self.simnet, self.simme, 
self.simsock)        
        rpc.MicroUDPServer(self, ('', 269), None, self.simnet, self.simme, 
self.simsock)

where self is an istance of NtkNode.

By reading rpc.py, you can understand that  `client = rpc.TCPClient(port=PORT)' 
isn't a MyMod instance.
`connected' is an attribute of  TCPClient, therefore it is lecit to use 
"self.ntk_client[ip].connected"


Btw, your description is good. It can be expanded as an introduction
to the pyntk code. When you have time clean it and put it somewhere in
the wiki.

-- 
:wq!
"I don't know nothing" The One Who reached the Thinking Matter   '.'

[ Alpt --- Freaknet Medialab ]
[ GPG Key ID 441CF0EE ]
[ Key fingerprint = 8B02 26E8 831A 7BB9 81A9  5277 BFF8 037E 441C F0EE ]
_______________________________________________
Netsukuku mailing list
[email protected]
http://lists.dyne.org/mailman/listinfo/netsukuku

Reply via email to