<s> from twisted . spread import pb <EOL> from twisted . internet import reactor <EOL> def main ( ) : <EOL> factory = pb . PBClientFactory ( ) <EOL> reactor . connectTCP ( "<STR_LIT:localhost>" , <NUM_LIT> , factory ) <EOL> def1 = factory . getRootObject ( ) <EOL> def1 . addCallbacks ( got_obj1 , err_obj1 ) <EOL> reactor . run ( ) <EOL> def err_obj1 ( reason ) : <EOL> print "<STR_LIT>" , reason <EOL> reactor . stop ( ) <EOL> def got_obj1 ( obj1 ) : <EOL> print "<STR_LIT>" , obj1 <EOL> print "<STR_LIT>" <EOL> def2 = obj1 . callRemote ( "<STR_LIT>" ) <EOL> def2 . addCallbacks ( got_obj2 ) <EOL> def got_obj2 ( obj2 ) : <EOL> print "<STR_LIT>" , obj2 <EOL> print "<STR_LIT>" <EOL> obj2 . callRemote ( "<STR_LIT>" , <NUM_LIT:12> ) <EOL> main ( ) </s>
