DDraceNetwork Docs
CNetConnection Class Reference

#include <network.h>

Collaboration diagram for CNetConnection:
[legend]

Public Member Functions

void SetToken7 (TOKEN Token)
 
void Reset (bool Rejoin=false)
 
void Init (NETSOCKET Socket, bool BlockCloseMsg)
 
int Connect (const NETADDR *pAddr, int NumAddrs)
 
int Connect7 (const NETADDR *pAddr, int NumAddrs)
 
void Disconnect (const char *pReason)
 
int Update ()
 
int Flush ()
 
int Feed (CNetPacketConstruct *pPacket, NETADDR *pAddr, SECURITY_TOKEN SecurityToken=NET_SECURITY_TOKEN_UNSUPPORTED, SECURITY_TOKEN ResponseToken=NET_SECURITY_TOKEN_UNSUPPORTED)
 
int QueueChunk (int Flags, int DataSize, const void *pData)
 
const char * ErrorString ()
 
void SignalResend ()
 
int State () const
 
const NETADDRPeerAddress () const
 
const char(* PeerAddressString () const)[NETADDR_MAXSTRSIZE]
 
void ConnectAddresses (const NETADDR **ppAddrs, int *pNumAddrs) const
 
void ResetErrorString ()
 
const char * ErrorString () const
 
int64_t LastRecvTime () const
 
int64_t ConnectTime () const
 
int AckSequence () const
 
int SeqSequence () const
 
int SecurityToken () const
 
CStaticRingBuffer< CNetChunkResend, NET_CONN_BUFFERSIZE > * ResendBuffer ()
 
void SetTimedOut (const NETADDR *pAddr, int Sequence, int Ack, SECURITY_TOKEN SecurityToken, CStaticRingBuffer< CNetChunkResend, NET_CONN_BUFFERSIZE > *pResendBuffer, bool Sixup)
 
void DirectInit (const NETADDR &Addr, SECURITY_TOKEN SecurityToken, SECURITY_TOKEN Token, bool Sixup)
 
void SetUnknownSeq ()
 
void SetSequence (int Sequence)
 

Public Attributes

SECURITY_TOKEN m_SecurityToken
 
bool m_TimeoutProtected
 
bool m_TimeoutSituation
 
bool m_Sixup
 
SECURITY_TOKEN m_Token
 

Private Member Functions

bool IsSixup ()
 
void ResetStats ()
 
void SetError (const char *pString)
 
void AckChunks (int Ack)
 
int QueueChunkEx (int Flags, int DataSize, const void *pData, int Sequence)
 
void SendConnect ()
 
void SendControl (int ControlMsg, const void *pExtra, int ExtraSize)
 
void SendControlWithToken7 (int ControlMsg, SECURITY_TOKEN ResponseToken)
 
void ResendChunk (CNetChunkResend *pResend)
 
void Resend ()
 

Static Private Member Functions

static TOKEN GenerateToken7 (const NETADDR *pPeerAddr)
 

Private Attributes

unsigned short m_Sequence
 
unsigned short m_Ack
 
unsigned short m_PeerAck
 
unsigned m_State
 
int m_RemoteClosed
 
bool m_BlockCloseMsg
 
bool m_UnknownSeq
 
CStaticRingBuffer< CNetChunkResend, NET_CONN_BUFFERSIZEm_Buffer
 
int64_t m_LastUpdateTime
 
int64_t m_LastRecvTime
 
int64_t m_LastSendTime
 
char m_aErrorString [256]
 
CNetPacketConstruct m_Construct
 
NETADDR m_aConnectAddrs [16]
 
int m_NumConnectAddrs
 
NETADDR m_PeerAddr
 
NETSOCKET m_Socket
 
NETSTATS m_Stats
 
char m_aPeerAddrStr [NETADDR_MAXSTRSIZE]
 
class CNetBasem_pNetBase
 

Friends

class CNetRecvUnpacker
 

Member Function Documentation

◆ AckChunks()

void CNetConnection::AckChunks ( int  Ack)
private

◆ AckSequence()

int CNetConnection::AckSequence ( ) const
inline

◆ Connect()

int CNetConnection::Connect ( const NETADDR pAddr,
int  NumAddrs 
)

◆ Connect7()

int CNetConnection::Connect7 ( const NETADDR pAddr,
int  NumAddrs 
)

◆ ConnectAddresses()

void CNetConnection::ConnectAddresses ( const NETADDR **  ppAddrs,
int *  pNumAddrs 
) const
inline

◆ ConnectTime()

int64_t CNetConnection::ConnectTime ( ) const
inline

◆ DirectInit()

void CNetConnection::DirectInit ( const NETADDR Addr,
SECURITY_TOKEN  SecurityToken,
SECURITY_TOKEN  Token,
bool  Sixup 
)

◆ Disconnect()

void CNetConnection::Disconnect ( const char *  pReason)

◆ ErrorString() [1/2]

const char * CNetConnection::ErrorString ( )

◆ ErrorString() [2/2]

const char * CNetConnection::ErrorString ( ) const
inline

◆ Feed()

int CNetConnection::Feed ( CNetPacketConstruct pPacket,
NETADDR pAddr,
SECURITY_TOKEN  SecurityToken = NET_SECURITY_TOKEN_UNSUPPORTED,
SECURITY_TOKEN  ResponseToken = NET_SECURITY_TOKEN_UNSUPPORTED 
)

◆ Flush()

int CNetConnection::Flush ( )

◆ GenerateToken7()

TOKEN CNetConnection::GenerateToken7 ( const NETADDR pPeerAddr)
staticprivate

◆ Init()

void CNetConnection::Init ( NETSOCKET  Socket,
bool  BlockCloseMsg 
)

◆ IsSixup()

bool CNetConnection::IsSixup ( )
inlineprivate

◆ LastRecvTime()

int64_t CNetConnection::LastRecvTime ( ) const
inline

◆ PeerAddress()

const NETADDR * CNetConnection::PeerAddress ( ) const
inline

◆ PeerAddressString()

const char(* CNetConnection::PeerAddressString ( ) )[NETADDR_MAXSTRSIZE]
inline

◆ QueueChunk()

int CNetConnection::QueueChunk ( int  Flags,
int  DataSize,
const void *  pData 
)

◆ QueueChunkEx()

int CNetConnection::QueueChunkEx ( int  Flags,
int  DataSize,
const void *  pData,
int  Sequence 
)
private

◆ Resend()

void CNetConnection::Resend ( )
private

◆ ResendBuffer()

CStaticRingBuffer< CNetChunkResend, NET_CONN_BUFFERSIZE > * CNetConnection::ResendBuffer ( )
inline

◆ ResendChunk()

void CNetConnection::ResendChunk ( CNetChunkResend pResend)
private

◆ Reset()

void CNetConnection::Reset ( bool  Rejoin = false)

◆ ResetErrorString()

void CNetConnection::ResetErrorString ( )
inline

◆ ResetStats()

void CNetConnection::ResetStats ( )
private

◆ SecurityToken()

int CNetConnection::SecurityToken ( ) const
inline

◆ SendConnect()

void CNetConnection::SendConnect ( )
private

◆ SendControl()

void CNetConnection::SendControl ( int  ControlMsg,
const void *  pExtra,
int  ExtraSize 
)
private

◆ SendControlWithToken7()

void CNetConnection::SendControlWithToken7 ( int  ControlMsg,
SECURITY_TOKEN  ResponseToken 
)
private

◆ SeqSequence()

int CNetConnection::SeqSequence ( ) const
inline

◆ SetError()

void CNetConnection::SetError ( const char *  pString)
private

◆ SetSequence()

void CNetConnection::SetSequence ( int  Sequence)
inline

◆ SetTimedOut()

void CNetConnection::SetTimedOut ( const NETADDR pAddr,
int  Sequence,
int  Ack,
SECURITY_TOKEN  SecurityToken,
CStaticRingBuffer< CNetChunkResend, NET_CONN_BUFFERSIZE > *  pResendBuffer,
bool  Sixup 
)

◆ SetToken7()

void CNetConnection::SetToken7 ( TOKEN  Token)

◆ SetUnknownSeq()

void CNetConnection::SetUnknownSeq ( )
inline

◆ SignalResend()

void CNetConnection::SignalResend ( )

◆ State()

int CNetConnection::State ( ) const
inline

◆ Update()

int CNetConnection::Update ( )

Friends And Related Function Documentation

◆ CNetRecvUnpacker

friend class CNetRecvUnpacker
friend

Member Data Documentation

◆ m_Ack

unsigned short CNetConnection::m_Ack
private

◆ m_aConnectAddrs

NETADDR CNetConnection::m_aConnectAddrs[16]
private

◆ m_aErrorString

char CNetConnection::m_aErrorString[256]
private

◆ m_aPeerAddrStr

char CNetConnection::m_aPeerAddrStr[NETADDR_MAXSTRSIZE]
private

◆ m_BlockCloseMsg

bool CNetConnection::m_BlockCloseMsg
private

◆ m_Buffer

CStaticRingBuffer<CNetChunkResend, NET_CONN_BUFFERSIZE> CNetConnection::m_Buffer
private

◆ m_Construct

CNetPacketConstruct CNetConnection::m_Construct
private

◆ m_LastRecvTime

int64_t CNetConnection::m_LastRecvTime
private

◆ m_LastSendTime

int64_t CNetConnection::m_LastSendTime
private

◆ m_LastUpdateTime

int64_t CNetConnection::m_LastUpdateTime
private

◆ m_NumConnectAddrs

int CNetConnection::m_NumConnectAddrs
private

◆ m_PeerAck

unsigned short CNetConnection::m_PeerAck
private

◆ m_PeerAddr

NETADDR CNetConnection::m_PeerAddr
private

◆ m_pNetBase

class CNetBase* CNetConnection::m_pNetBase
private

◆ m_RemoteClosed

int CNetConnection::m_RemoteClosed
private

◆ m_SecurityToken

SECURITY_TOKEN CNetConnection::m_SecurityToken

◆ m_Sequence

unsigned short CNetConnection::m_Sequence
private

◆ m_Sixup

bool CNetConnection::m_Sixup

◆ m_Socket

NETSOCKET CNetConnection::m_Socket
private

◆ m_State

unsigned CNetConnection::m_State
private

◆ m_Stats

NETSTATS CNetConnection::m_Stats
private

◆ m_TimeoutProtected

bool CNetConnection::m_TimeoutProtected

◆ m_TimeoutSituation

bool CNetConnection::m_TimeoutSituation

◆ m_Token

SECURITY_TOKEN CNetConnection::m_Token

◆ m_UnknownSeq

bool CNetConnection::m_UnknownSeq
private

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