Package pygsear :: Module Network :: Class TwoPlayerConnection
[show private | hide private]
[frames | no frames]

Class TwoPlayerConnection

    Jellyable --+        
                |        
     Serializable --+    
                    |    
        Referenceable --+
                        |
Jellyable --+           |
            |           |
 Serializable --+       |
                |       |
    Referenceable --+   |
                    |   |
                 Root --+
                        |
                       TwoPlayerConnection


Simple two player network connector

First tries to connect to an existing server, and if none is found, will then wait for an incoming connection.
Method Summary
  __init__(self, game)
  got_connection(self, connection)
Client gets server's connection.
  gotNoObject(self, reason)
If no server answers, then start one.
  gotObject(self, connection)
If server exists, and contact is made.
  makeConnection(self)
Try to connect to an existing server.
  remote_give_connection(self, connection)
Server gets client's Connection, and returns it's own Connection to client.
  startListening(self)
Start a server, and wait for a connection attempt.
    Inherited from Root
  rootObject(self, broker)
A pb.BrokerFactory is requesting to publish me as a root object.
    Inherited from Referenceable
  jellyFor(self, jellier)
(internal)
  remoteMessageReceived(self, broker, message, args, kw)
A remote message has been received.
    Inherited from Serializable
  processUniqueID(self)
Return an ID which uniquely represents this object for this process.
    Inherited from Jellyable
  getStateFor(self, jellier)

Class Variable Summary
    Inherited from Root
Implements __implemented__ = <implementedBy twisted.spread.flavors....
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
    Inherited from Referenceable
NoneType perspective = None                                                                  
    Inherited from Jellyable
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...

Method Details

got_connection(self, connection)

Client gets server's connection.

gotNoObject(self, reason)

If no server answers, then start one.

gotObject(self, connection)

If server exists, and contact is made.

makeConnection(self)

Try to connect to an existing server.

remote_give_connection(self, connection)

Server gets client's Connection, and returns it's own Connection to client.

startListening(self)

Start a server, and wait for a connection attempt.

Generated by Epydoc 2.0 on Sat Dec 9 14:11:18 2006 http://epydoc.sf.net