RakNet  4.0
Public Member Functions | List of all members
RakNet::ReliabilityLayer Class Reference

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

#include <ReliabilityLayer.h>

Public Member Functions

void Reset (bool resetVariables, int MTUSize, bool _useSecurity)
 Resets the layer for reuse.
 
void SetTimeoutTime (RakNet::TimeMS time)
 
RakNet::TimeMS GetTimeoutTime (void)
 
bool HandleSocketReceiveFromConnectedPlayer (const char *buffer, unsigned int length, SystemAddress &systemAddress, DataStructures::List< PluginInterface2 * > &messageHandlerList, int MTUSize, RakNetSocket2 *s, RakNetRandom *rnr, CCTimeType timeRead, BitStream &updateBitStream)
 
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 (RakNetSocket2 *s, SystemAddress &systemAddress, int MTUSize, CCTimeType time, unsigned bitsPerSecondLimit, DataStructures::List< PluginInterface2 * > &messageHandlerList, RakNetRandom *rnr, BitStream &updateBitStream)
 
bool IsDeadConnection (void) const
 
void KillConnection (void)
 Causes IsDeadConnection to return true.
 
RakNetStatisticsGetStatistics (RakNetStatistics *rns)
 
bool IsOutgoingDataWaiting (void)
 Are we waiting for any data to be sent out or be processed by the player?
 
bool IsNetworkSimulatorActive (void)
 
bool AckTimeout (RakNet::Time curTime)
 Has a lot of time passed since the last ack.
 

Detailed Description

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

Member Function Documentation

RakNetStatistics* RakNet::ReliabilityLayer::GetStatistics ( RakNetStatistics rns)

Get Statistics

Returns
A pointer to a static struct, filled out with current statistical information.
RakNet::TimeMS RakNet::ReliabilityLayer::GetTimeoutTime ( void  )

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

Parameters
[out]thevalue passed to SetTimeoutTime
bool RakNet::ReliabilityLayer::HandleSocketReceiveFromConnectedPlayer ( const char *  buffer,
unsigned int  length,
SystemAddress systemAddress,
DataStructures::List< PluginInterface2 * > &  messageHandlerList,
int  MTUSize,
RakNetSocket2 *  s,
RakNetRandom *  rnr,
CCTimeType  timeRead,
BitStream updateBitStream 
)

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]bufferThe socket data
[in]lengthThe length of the socket data
[in]systemAddressThe player that this data is from
[in]messageHandlerListA list of registered plugins
[in]MTUSizemaximum datagram size
Return values
trueSuccess
falseModified packet
bool RakNet::ReliabilityLayer::IsDeadConnection ( void  ) const

Were you ever unable to deliver a packet despite retries?

Returns
true means the connection has been lost. Otherwise not.
bool RakNet::ReliabilityLayer::IsNetworkSimulatorActive ( void  )

Returns if you previously called ApplyNetworkSimulator

Returns
If you previously called ApplyNetworkSimulator
BitSize_t RakNet::ReliabilityLayer::Receive ( unsigned char **  data)

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

Parameters
[out]dataThe message
Returns
Returns number of BITS put into the buffer
bool RakNet::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]dataThe data to send
[in]numberOfBitsToSendThe length of data in bits
[in]priorityThe priority level for the send
[in]reliabilityThe reliability type for the send
[in]orderingChannel0 to 31. Specifies what channel to use, for relational ordering and sequencing of packets.
[in]makeDataCopyIf true data will be copied. Otherwise, only a pointer will be stored.
[in]MTUSizemaximum datagram size
[in]currentTimeCurrent time, as per RakNet::GetTimeMS()
[in]receiptThis 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.
void RakNet::ReliabilityLayer::SetTimeoutTime ( RakNet::TimeMS  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]timeTime, in MS
void RakNet::ReliabilityLayer::Update ( RakNetSocket2 *  s,
SystemAddress systemAddress,
int  MTUSize,
CCTimeType  time,
unsigned  bitsPerSecondLimit,
DataStructures::List< PluginInterface2 * > &  messageHandlerList,
RakNetRandom *  rnr,
BitStream updateBitStream 
)

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

Parameters
[in]sthe communication end point
[in]systemAddressThe Unique Player Identifier who shouldhave sent some packets
[in]MTUSizemaximum datagram size
[in]timecurrent system time
[in]maxBitsPerSecondif non-zero, enforces that outgoing bandwidth does not exceed this amount
[in]messageHandlerListA list of registered plugins

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