Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
NetLink Class Reference

#include <NetLink.h>

List of all members.

Public Member Functions

 NetLink ()
 NetLink (NetAddr &a)
virtual ~NetLink ()
int operator== (const NetLink &that) const
const NetAddrGetAddress () const
DWORD AddPeer (const char *a, WORD p=12345)
DWORD AddPeer (DWORD a, WORD p=12345)
DWORD AddPeer (const NetAddr &a)
bool SendMessage (DWORD nid, void *d, int l, BYTE f=0)
bool SendMessage (DWORD nid, BYTE type, const char *text, int len, BYTE f=0)
bool SendMessage (NetMsg *msg)
NetMsgGetMessage ()
NetMsgGetMessage (DWORD netid)
virtual void Shutdown ()
DWORD DoSendRecv ()
DWORD GetResendInterval () const
void SetResendInterval (DWORD t)
DWORD GetTrafficInterval () const
void SetTrafficInterval (DWORD t)
DWORD GetPacketsSent () const
DWORD GetPacketsRecv () const
DWORD GetBytesSent () const
DWORD GetBytesRecv () const
DWORD GetRetries () const
DWORD GetDrops () const
DWORD GetLag () const
NetPeerFindPeer (const NetAddr &a)
NetPeerFindPeer (DWORD netid)

Static Public Member Functions

static const char * TYPENAME ()

Protected Member Functions

void SendNetGram (NetGram *g)
NetGramRecvNetGram ()
void AckNetGram (NetGram *gram)
void ProcessAck (NetGram *gram)
void QueueNetGram (NetGram *gram)
void ReadPackets ()
void SendPackets ()
void DoRetries ()

Protected Attributes

NetAddr addr
NetSock sock
List< NetGramsend_list
List< NetMsgrecv_list
List< NetPeerpeer_list
HANDLE hnet
bool shutdown
ThreadSync sync
DWORD resend_time
DWORD traffic_time
DWORD packets_sent
DWORD packets_recv
DWORD bytes_sent
DWORD bytes_recv
DWORD retries
DWORD drops
DWORD lag
DWORD lag_samples [10]
int lag_index

Detailed Description

Definition at line 33 of file NetLink.h.


Constructor & Destructor Documentation

NetLink::NetLink ( )

Definition at line 31 of file NetLink.cpp.

NetLink::NetLink ( NetAddr a)

Definition at line 43 of file NetLink.cpp.

NetLink::~NetLink ( )
virtual

Definition at line 55 of file NetLink.cpp.


Member Function Documentation

void NetLink::AckNetGram ( NetGram gram)
protected

Definition at line 333 of file NetLink.cpp.

DWORD NetLink::AddPeer ( const char *  a,
WORD  p = 12345 
)

Definition at line 76 of file NetLink.cpp.

DWORD NetLink::AddPeer ( DWORD  a,
WORD  p = 12345 
)

Definition at line 82 of file NetLink.cpp.

DWORD NetLink::AddPeer ( const NetAddr a)

Definition at line 88 of file NetLink.cpp.

void NetLink::DoRetries ( )
protected

Definition at line 418 of file NetLink.cpp.

DWORD NetLink::DoSendRecv ( )

Definition at line 215 of file NetLink.cpp.

NetPeer * NetLink::FindPeer ( const NetAddr a)

Definition at line 473 of file NetLink.cpp.

NetPeer * NetLink::FindPeer ( DWORD  netid)

Definition at line 456 of file NetLink.cpp.

const NetAddr& NetLink::GetAddress ( ) const
inline

Definition at line 44 of file NetLink.h.

DWORD NetLink::GetBytesRecv ( ) const
inline

Definition at line 68 of file NetLink.h.

DWORD NetLink::GetBytesSent ( ) const
inline

Definition at line 67 of file NetLink.h.

DWORD NetLink::GetDrops ( ) const
inline

Definition at line 70 of file NetLink.h.

DWORD NetLink::GetLag ( ) const
inline

Definition at line 71 of file NetLink.h.

NetMsg * NetLink::GetMessage ( )

Definition at line 167 of file NetLink.cpp.

NetMsg * NetLink::GetMessage ( DWORD  netid)

Definition at line 145 of file NetLink.cpp.

DWORD NetLink::GetPacketsRecv ( ) const
inline

Definition at line 66 of file NetLink.h.

DWORD NetLink::GetPacketsSent ( ) const
inline

Definition at line 65 of file NetLink.h.

DWORD NetLink::GetResendInterval ( ) const
inline

Definition at line 60 of file NetLink.h.

DWORD NetLink::GetRetries ( ) const
inline

Definition at line 69 of file NetLink.h.

DWORD NetLink::GetTrafficInterval ( ) const
inline

Definition at line 62 of file NetLink.h.

int NetLink::operator== ( const NetLink that) const
inline

Definition at line 42 of file NetLink.h.

void NetLink::ProcessAck ( NetGram gram)
protected

Definition at line 348 of file NetLink.cpp.

void NetLink::QueueNetGram ( NetGram gram)
protected

Definition at line 384 of file NetLink.cpp.

void NetLink::ReadPackets ( )
protected

Definition at line 240 of file NetLink.cpp.

NetGram * NetLink::RecvNetGram ( )
protected

Definition at line 319 of file NetLink.cpp.

bool NetLink::SendMessage ( DWORD  nid,
void *  d,
int  l,
BYTE  f = 0 
)

Definition at line 112 of file NetLink.cpp.

bool NetLink::SendMessage ( DWORD  nid,
BYTE  type,
const char *  text,
int  len,
BYTE  f = 0 
)

Definition at line 118 of file NetLink.cpp.

bool NetLink::SendMessage ( NetMsg msg)

Definition at line 124 of file NetLink.cpp.

void NetLink::SendNetGram ( NetGram g)
protected

Definition at line 296 of file NetLink.cpp.

void NetLink::SendPackets ( )
protected

Definition at line 262 of file NetLink.cpp.

void NetLink::SetResendInterval ( DWORD  t)
inline

Definition at line 61 of file NetLink.h.

void NetLink::SetTrafficInterval ( DWORD  t)
inline

Definition at line 63 of file NetLink.h.

void NetLink::Shutdown ( )
virtual

Definition at line 197 of file NetLink.cpp.

static const char* NetLink::TYPENAME ( )
inlinestatic

Definition at line 36 of file NetLink.h.


Member Data Documentation

NetAddr NetLink::addr
protected

Definition at line 87 of file NetLink.h.

DWORD NetLink::bytes_recv
protected

Definition at line 103 of file NetLink.h.

DWORD NetLink::bytes_sent
protected

Definition at line 102 of file NetLink.h.

DWORD NetLink::drops
protected

Definition at line 105 of file NetLink.h.

HANDLE NetLink::hnet
protected

Definition at line 93 of file NetLink.h.

DWORD NetLink::lag
protected

Definition at line 106 of file NetLink.h.

int NetLink::lag_index
protected

Definition at line 109 of file NetLink.h.

DWORD NetLink::lag_samples[10]
protected

Definition at line 108 of file NetLink.h.

DWORD NetLink::packets_recv
protected

Definition at line 101 of file NetLink.h.

DWORD NetLink::packets_sent
protected

Definition at line 100 of file NetLink.h.

List<NetPeer> NetLink::peer_list
protected

Definition at line 91 of file NetLink.h.

List<NetMsg> NetLink::recv_list
protected

Definition at line 90 of file NetLink.h.

DWORD NetLink::resend_time
protected

Definition at line 97 of file NetLink.h.

DWORD NetLink::retries
protected

Definition at line 104 of file NetLink.h.

List<NetGram> NetLink::send_list
protected

Definition at line 89 of file NetLink.h.

bool NetLink::shutdown
protected

Definition at line 94 of file NetLink.h.

NetSock NetLink::sock
protected

Definition at line 88 of file NetLink.h.

ThreadSync NetLink::sync
protected

Definition at line 95 of file NetLink.h.

DWORD NetLink::traffic_time
protected

Definition at line 98 of file NetLink.h.


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