~soren/nova/iptables-security-groups

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/doc/core/howto/listings/pb/pb6client2.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
# Copyright (c) 2009 Twisted Matrix Laboratories.
 
4
# See LICENSE for details.
 
5
 
 
6
from twisted.spread import pb
 
7
from twisted.internet import reactor
 
8
 
 
9
from twisted.spread import pb
 
10
from twisted.internet import reactor
 
11
from twisted.cred import credentials
 
12
 
 
13
def main():
 
14
    factory = pb.PBClientFactory()
 
15
    reactor.connectTCP("localhost", 8800, factory)
 
16
    def1 = factory.login(credentials.UsernamePassword("user2", "pass2"))
 
17
    def1.addCallback(connected)
 
18
    reactor.run()
 
19
 
 
20
def connected(perspective):
 
21
    print "got perspective2 ref:", perspective
 
22
    print "asking it to foo(14)"
 
23
    perspective.callRemote("foo", 14)
 
24
 
 
25
main()