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

Class Peer

     object --+    
              |    
metrics.Metrics --+
                  |
                 Peer


A connection to the server. Each connected Client has a paired
Peer object instance on the server.

Instance Methods
 
__init__(self, parent=None, address=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
do_read(self, callback)
 
process_inbound_packet(self, rawData)
 
has_packets_to_send(self)
 
send_message(self, packet)
Adds a packet to the outgoing buffer to be sent to the client.
 
send_reliable_message(self, packet)
 
disconnect(self)
Disconnect this peer.
 
update(self)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties
  address
  connected
  in_bytes
Count of bytes received (header + data).
  is_server
  latency
Round-trip latency in ms
  message_factory
  out_buffer_bytes
Count of bytes waiting to be transmitted on the wire.
  out_bytes
Count of bytes recieved (header + data).
  timeout
  last_packet_sent_at
  in_messages
Count of messages received. (Inherited from legume.metrics.Metrics)
  in_packets
Count of packets received. (Inherited from legume.metrics.Metrics)
  keepalive_count
Count of keep-alive Ping or Pong messages sent/received. (Inherited from legume.metrics.Metrics)
  out_messages
Count of messages sent. (Inherited from legume.metrics.Metrics)
  out_packets
Count of packets sent. (Inherited from legume.metrics.Metrics)
  pending_acks
Packets that have not yet been acknowledged. (Inherited from legume.metrics.Metrics)
  reorder_queue
Number of out-of-order messages received that are waiting to be inserted into the message stream. (Inherited from legume.metrics.Metrics)

Inherited from object: __class__

Method Details

__init__(self, parent=None, address=None)
(Constructor)

 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

send_message(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.
Returns the number of bytes added to the output buffer for
sending this message (header + message bytes)

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

address

Get Method:
unreachable.address(self)

connected

Get Method:
unreachable.connected(self)

in_bytes

Count of bytes received (header + data).

Get Method:
unreachable.in_bytes(self)

is_server

Get Method:
unreachable.is_server(self)

latency

Round-trip latency in ms

Get Method:
unreachable.latency(self)

message_factory

Get Method:
unreachable.message_factory(self)

out_buffer_bytes

Count of bytes waiting to be transmitted on the wire.

Get Method:
unreachable.out_buffer_bytes(self)

out_bytes

Count of bytes recieved (header + data).

Get Method:
unreachable.out_bytes(self)

timeout

Get Method:
unreachable.timeout(self)

last_packet_sent_at

Get Method:
unreachable.last_packet_sent_at(self)