Package legume :: Package udp :: Module serverpeer :: Class Peer
[frames] | no frames]

type Peer

object --+
         |
        Peer

A connection to the server. Each Client connection to the server has a separate instance.
Instance Methods
 
__init__(self, parent, address)
 
getLastPacketSentAt(self)
 
getAddress(self)
 
getTimeout(self)
 
doRead(self, callback)
 
processInboundPacket(self, rawData)
 
hasPacketsToSend(self)
 
sendMessage(self, packet)
Adds a packet to the outgoing buffer to be sent to the client.
 
sendReliableMessage(self, packet)
 
disconnect(self)
Disconnect this peer.
 
update(self)
Properties
  message_factory
  connected
  is_server
  lastPacketSentAt
  latency
  address
  timeout
Method Details

__init__(self, parent, address)
(Constructor)

 
Overrides: object.__init__
(inherited documentation)

sendMessage(self, packet)

 

Adds a packet to the outgoing buffer to be sent to the client. This does not set the in-order or reliable flags.

packet is an instance of BasePacket.

disconnect(self)

 
Disconnect this peer. A Disconnected message will be sent to the client and this peer object will be deleted once the outgoing buffer for this connection has emptied.

Property Details

message_factory

connected

is_server

lastPacketSentAt

Get Method:
getLastPacketSentAt(self)

latency

address

Get Method:
getAddress(self)

timeout

Get Method:
getTimeout(self)