2
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
3
# See LICENSE for details.
6
from twisted.internet import reactor
7
from twisted.spread import pb
8
from twisted.cred.credentials import UsernamePassword
10
from pbecho import DefinedError
13
print "Message received:",message
17
t = error.trap(DefinedError)
18
print "error received:", t
21
def connected(perspective):
22
perspective.callRemote('echo', "hello world").addCallbacks(success, failure)
23
perspective.callRemote('error').addCallbacks(success, failure)
27
factory = pb.PBClientFactory()
28
reactor.connectTCP("localhost", pb.portno, factory)
30
UsernamePassword("guest", "guest")).addCallbacks(connected, failure)