Classes | Public Member Functions

ReliabilityLayer Class Reference

Datagram reliable, ordered, unordered and sequenced sends. Flow control. Message splitting, reassembly, and coalescence. More...

#include <ReliabilityLayer.h>

Collaboration diagram for ReliabilityLayer:
Collaboration graph
[legend]

List of all members.

Classes

struct  DatagramHistoryNode
struct  MessageNumberNode

Public Member Functions

 ReliabilityLayer ()
 ~ReliabilityLayer ()
void Reset (bool resetVariables, int MTUSize)
 Resets the layer for reuse.
void SetEncryptionKey (const unsigned char *key)
void SetTimeoutTime (RakNetTimeMS time)
RakNetTimeMS GetTimeoutTime (void)
bool HandleSocketReceiveFromConnectedPlayer (const char *buffer, unsigned int length, SystemAddress systemAddress, DataStructures::List< PluginInterface2 * > &messageHandlerList, int MTUSize, SOCKET s, RakNetRandom *rnr, unsigned short remotePortRakNetWasStartedOn_PS3, CCTimeType timeRead)
BitSize_t Receive (unsigned char **data)
bool Send (char *data, BitSize_t numberOfBitsToSend, PacketPriority priority, PacketReliability reliability, unsigned char orderingChannel, bool makeDataCopy, int MTUSize, CCTimeType currentTime, uint32_t receipt)
void Update (SOCKET s, SystemAddress systemAddress, int MTUSize, CCTimeType time, unsigned bitsPerSecondLimit, DataStructures::List< PluginInterface2 * > &messageHandlerList, RakNetRandom *rnr, unsigned short remotePortRakNetWasStartedOn_PS3)
bool IsCheater (void) const
bool IsDeadConnection (void) const
void KillConnection (void)
 Causes IsDeadConnection to return true.
RakNetStatistics *const GetStatistics (RakNetStatistics *rns)
bool IsOutgoingDataWaiting (void)
 Are we waiting for any data to be sent out or be processed by the player?
bool AreAcksWaiting (void)
void ApplyNetworkSimulator (double _maxSendBPS, RakNetTime _minExtraPing, RakNetTime _extraPingVariance)
bool IsNetworkSimulatorActive (void)
void SetSplitMessageProgressInterval (int interval)
void SetUnreliableTimeout (RakNetTimeMS timeoutMS)
bool AckTimeout (RakNetTimeMS curTime)
 Has a lot of time passed since the last ack.
CCTimeType GetNextSendTime (void) const
CCTimeType GetTimeBetweenPackets (void) const
CCTimeType GetAckPing (void) const
RakNetTimeMS GetTimeLastDatagramArrived (void) const

Detailed Description

Datagram reliable, ordered, unordered and sequenced sends. Flow control. Message splitting, reassembly, and coalescence.

Definition at line 100 of file ReliabilityLayer.h.


Constructor & Destructor Documentation

ReliabilityLayer::ReliabilityLayer (  ) 

Definition at line 268 of file ReliabilityLayer.cpp.

Here is the call graph for this function:

ReliabilityLayer::~ReliabilityLayer (  ) 

Definition at line 296 of file ReliabilityLayer.cpp.


Member Function Documentation

bool ReliabilityLayer::AckTimeout ( RakNetTimeMS  curTime  ) 

Has a lot of time passed since the last ack.

Definition at line 2863 of file ReliabilityLayer.cpp.

Here is the caller graph for this function:

void ReliabilityLayer::ApplyNetworkSimulator ( double  _maxSendBPS,
RakNetTime  _minExtraPing,
RakNetTime  _extraPingVariance 
)

Definition at line 1921 of file ReliabilityLayer.cpp.

Here is the caller graph for this function:

bool ReliabilityLayer::AreAcksWaiting ( void   ) 

Definition at line 1915 of file ReliabilityLayer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

CCTimeType ReliabilityLayer::GetAckPing ( void   )  const

Definition at line 2884 of file ReliabilityLayer.cpp.

CCTimeType ReliabilityLayer::GetNextSendTime ( void   )  const

Definition at line 2874 of file ReliabilityLayer.cpp.

RakNetStatistics *const ReliabilityLayer::GetStatistics ( RakNetStatistics rns  ) 

Get Statistics

Returns:
A pointer to a static struct, filled out with current statistical information.

Definition at line 2807 of file ReliabilityLayer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

CCTimeType ReliabilityLayer::GetTimeBetweenPackets ( void   )  const

Definition at line 2879 of file ReliabilityLayer.cpp.

RakNetTimeMS ReliabilityLayer::GetTimeLastDatagramArrived ( void   )  const [inline]

Definition at line 203 of file ReliabilityLayer.h.

RakNetTimeMS ReliabilityLayer::GetTimeoutTime ( void   ) 

Returns the value passed to SetTimeoutTime. or the default if it was never called

Parameters:
[out] the value passed to SetTimeoutTime

Definition at line 339 of file ReliabilityLayer.cpp.

Here is the caller graph for this function:

bool ReliabilityLayer::HandleSocketReceiveFromConnectedPlayer ( const char *  buffer,
unsigned int  length,
SystemAddress  systemAddress,
DataStructures::List< PluginInterface2 * > &  messageHandlerList,
int  MTUSize,
SOCKET  s,
RakNetRandom rnr,
unsigned short  remotePortRakNetWasStartedOn_PS3,
CCTimeType  timeRead 
)

Packets are read directly from the socket layer and skip the reliability layer because unconnected players do not use the reliability layer This function takes packet data after a player has been confirmed as connected.

Parameters:
[in] buffer The socket data
[in] length The length of the socket data
[in] systemAddress The player that this data is from
[in] messageHandlerList A list of registered plugins
[in] MTUSize maximum datagram size
Return values:
true Success
false Modified packet

Definition at line 585 of file ReliabilityLayer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool ReliabilityLayer::IsCheater ( void   )  const

If Read returns -1 and this returns true then a modified packetwas detected

Returns:
true when a modified packet is detected

Definition at line 2782 of file ReliabilityLayer.cpp.

Here is the caller graph for this function:

bool ReliabilityLayer::IsDeadConnection ( void   )  const

Were you ever unable to deliver a packet despite retries?

Returns:
true means the connection has been lost. Otherwise not.

Definition at line 2790 of file ReliabilityLayer.cpp.

Here is the caller graph for this function:

bool ReliabilityLayer::IsNetworkSimulatorActive ( void   ) 

Returns if you previously called ApplyNetworkSimulator

Returns:
If you previously called ApplyNetworkSimulator
bool ReliabilityLayer::IsOutgoingDataWaiting ( void   ) 

Are we waiting for any data to be sent out or be processed by the player?

Definition at line 1898 of file ReliabilityLayer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ReliabilityLayer::KillConnection ( void   ) 

Causes IsDeadConnection to return true.

Definition at line 2798 of file ReliabilityLayer.cpp.

BitSize_t ReliabilityLayer::Receive ( unsigned char **  data  ) 

This allocates bytes and writes a user-level message to those bytes.

Parameters:
[out] data The message
Returns:
Returns number of BITS put into the buffer

Definition at line 1104 of file ReliabilityLayer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ReliabilityLayer::Reset ( bool  resetVariables,
int  MTUSize 
)

Resets the layer for reuse.

Definition at line 303 of file ReliabilityLayer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool ReliabilityLayer::Send ( char *  data,
BitSize_t  numberOfBitsToSend,
PacketPriority  priority,
PacketReliability  reliability,
unsigned char  orderingChannel,
bool  makeDataCopy,
int  MTUSize,
CCTimeType  currentTime,
uint32_t  receipt 
)

Puts data on the send queue

Parameters:
[in] data The data to send
[in] numberOfBitsToSend The length of data in bits
[in] priority The priority level for the send
[in] reliability The reliability type for the send
[in] orderingChannel 0 to 31. Specifies what channel to use, for relational ordering and sequencing of packets.
[in] makeDataCopy If true data will be copied. Otherwise, only a pointer will be stored.
[in] MTUSize maximum datagram size
[in] currentTime Current time, as per RakNet::GetTime()
[in] receipt This number will be returned back with ID_SND_RECEIPT_ACKED or ID_SND_RECEIPT_LOSS and is only returned with the reliability types that contain RECEIPT in the name
Returns:
True or false for success or failure.

Definition at line 1140 of file ReliabilityLayer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ReliabilityLayer::SetEncryptionKey ( const unsigned char *  key  ) 

Sets the encryption key. Doing so will activate secure connections

Parameters:
[in] key Byte stream for the encryption key

Definition at line 320 of file ReliabilityLayer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ReliabilityLayer::SetSplitMessageProgressInterval ( int  interval  ) 

Definition at line 1932 of file ReliabilityLayer.cpp.

Here is the caller graph for this function:

void ReliabilityLayer::SetTimeoutTime ( RakNetTimeMS  time  ) 

Set the time, in MS, to use before considering ourselves disconnected after not being able to deliver a reliable packet Default time is 10,000 or 10 seconds in release and 30,000 or 30 seconds in debug.

Parameters:
[in] time Time, in MS

Definition at line 331 of file ReliabilityLayer.cpp.

Here is the caller graph for this function:

void ReliabilityLayer::SetUnreliableTimeout ( RakNetTimeMS  timeoutMS  ) 

Definition at line 1937 of file ReliabilityLayer.cpp.

Here is the caller graph for this function:

void ReliabilityLayer::Update ( SOCKET  s,
SystemAddress  systemAddress,
int  MTUSize,
CCTimeType  time,
unsigned  bitsPerSecondLimit,
DataStructures::List< PluginInterface2 * > &  messageHandlerList,
RakNetRandom rnr,
unsigned short  remotePortRakNetWasStartedOn_PS3 
)

Call once per game cycle. Handles internal lists and actually does the send.

Parameters:
[in] s the communication end point
[in] systemAddress The Unique Player Identifier who shouldhave sent some packets
[in] MTUSize maximum datagram size
[in] time current system time
[in] maxBitsPerSecond if non-zero, enforces that outgoing bandwidth does not exceed this amount
[in] messageHandlerList A list of registered plugins

Definition at line 1288 of file ReliabilityLayer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


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