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
`tuple` | `__implements__` = `(<class 'twisted.spread.flavors.IPBRoot...`
Inherited from Referenceable
`NoneType` | `perspective` = None

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 Fri Nov 11 14:26:39 2005 | http://epydoc.sf.net