Planeshift
NetBase::Connection Class Reference

This class holds data for a connection. More...

#include <netbase.h>

Public Member Functions

void AddToWindow (uint32_t bytes)
 Add to window when reliable data is in transit. More...
 
 Connection (uint32_t num=0)
 
uint32_t GetNextPacketID ()
 
bool isValid () const
 
bool IsWindowFull ()
 Check if the reliable transmission window is full. More...
 
void RemoveFromWindow (uint32_t bytes)
 Remove from transmission window when an ack is received. More...
 
 ~Connection ()
 

Public Attributes

SOCKADDR_IN addr
 The INet Adress of the client. More...
 
void * buf
 buffer for split up packets, allocated when needed More...
 
uint32_t clientnum
 the client num More...
 
float devRTT
 RTT deviance. More...
 
float estRTT
 Estimated RTT. More...
 
int heartbeat
 number of attempts to keep alive connection without ack response More...
 
int historypos
 
csTicks lastRecvPacketTime
 last time packet was received from this connection More...
 
csString nameAddr
 The adress if provided, usually in clients, else an empty csstring. More...
 
csHash< uint32_t > packethistoryhash
 
uint32_t packethistoryid [MAXPACKETHISTORY]
 keeps track of received packets to drop doubled packets More...
 
uint32_t packethistoryoffset [MAXPACKETHISTORY]
 
int pcknumin
 The Number of the last incoming packet. More...
 
int pcknumout
 The Number of the last outgoing packet. More...
 
uint32_t resends
 Number of resends. More...
 
csTicks RTO
 timeout More...
 
uint32_t sends
 Number of reliable sends. More...
 
bool valid
 Is this already a valid connection? More...
 
uint32_t window
 

Detailed Description

This class holds data for a connection.

Definition at line 684 of file netbase.h.

Constructor & Destructor Documentation

NetBase::Connection::Connection ( uint32_t  num = 0)
NetBase::Connection::~Connection ( )

Member Function Documentation

void NetBase::Connection::AddToWindow ( uint32_t  bytes)
inline

Add to window when reliable data is in transit.

Definition at line 736 of file netbase.h.

uint32_t NetBase::Connection::GetNextPacketID ( )
inline

Definition at line 731 of file netbase.h.

bool NetBase::Connection::isValid ( ) const
inline

Definition at line 728 of file netbase.h.

bool NetBase::Connection::IsWindowFull ( )
inline

Check if the reliable transmission window is full.

Definition at line 734 of file netbase.h.

void NetBase::Connection::RemoveFromWindow ( uint32_t  bytes)
inline

Remove from transmission window when an ack is received.

Definition at line 738 of file netbase.h.

Member Data Documentation

SOCKADDR_IN NetBase::Connection::addr

The INet Adress of the client.

Definition at line 692 of file netbase.h.

void* NetBase::Connection::buf

buffer for split up packets, allocated when needed

Definition at line 690 of file netbase.h.

uint32_t NetBase::Connection::clientnum

the client num

Definition at line 702 of file netbase.h.

float NetBase::Connection::devRTT

RTT deviance.

Definition at line 710 of file netbase.h.

float NetBase::Connection::estRTT

Estimated RTT.

Definition at line 708 of file netbase.h.

int NetBase::Connection::heartbeat

number of attempts to keep alive connection without ack response

Definition at line 706 of file netbase.h.

int NetBase::Connection::historypos

Definition at line 724 of file netbase.h.

csTicks NetBase::Connection::lastRecvPacketTime

last time packet was received from this connection

Definition at line 704 of file netbase.h.

csString NetBase::Connection::nameAddr

The adress if provided, usually in clients, else an empty csstring.

Definition at line 694 of file netbase.h.

csHash<uint32_t> NetBase::Connection::packethistoryhash

Definition at line 688 of file netbase.h.

uint32_t NetBase::Connection::packethistoryid[MAXPACKETHISTORY]

keeps track of received packets to drop doubled packets

Definition at line 722 of file netbase.h.

uint32_t NetBase::Connection::packethistoryoffset[MAXPACKETHISTORY]

Definition at line 723 of file netbase.h.

int NetBase::Connection::pcknumin

The Number of the last incoming packet.

Definition at line 696 of file netbase.h.

int NetBase::Connection::pcknumout

The Number of the last outgoing packet.

Definition at line 698 of file netbase.h.

uint32_t NetBase::Connection::resends

Number of resends.

Definition at line 716 of file netbase.h.

csTicks NetBase::Connection::RTO

timeout

Definition at line 712 of file netbase.h.

uint32_t NetBase::Connection::sends

Number of reliable sends.

Definition at line 714 of file netbase.h.

bool NetBase::Connection::valid

Is this already a valid connection?

Definition at line 700 of file netbase.h.

uint32_t NetBase::Connection::window

Definition at line 719 of file netbase.h.


The documentation for this class was generated from the following file: