Shadowrun: Awakened 29 September 2011 - Build 871
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
cat::sphynx::Transport Class Reference

#include <SphynxTransport.hpp>

Inheritance diagram for cat::sphynx::Transport:

List of all members.

Public Member Functions

void FlushWrite ()
void InitializePayloadBytes (bool ip6)
 Transport ()
bool WriteReliable (StreamMode, u8 msg_opcode, const void *msg_data=0, u32 data_bytes=0, SuperOpcode super_opcode=SOP_DATA)
bool WriteUnreliable (u8 msg_opcode, const void *msg_data=0, u32 data_bytes=0)
virtual ~Transport ()

Protected Member Functions

CAT_INLINE bool IsDisconnected ()
void OnDatagram (ThreadPoolLocalStorage *tls, u8 *data, u32 bytes)
virtual void OnDisconnect ()=0
virtual void OnMessage (ThreadPoolLocalStorage *tls, BufferStream msg, u32 bytes)=0
virtual void OnTimestampDeltaUpdate (u32 rtt, s32 delta)
bool PostDisconnect ()
bool PostMTUProbe (ThreadPoolLocalStorage *tls, u16 payload_bytes)
virtual bool PostPacket (u8 *data, u32 buf_bytes, u32 msg_bytes, u32 skip_bytes)=0
bool PostTimePing ()
bool PostTimePong (u32 client_ts)
void TickTransport (ThreadPoolLocalStorage *tls, u32 now)
CAT_INLINE void TransportDisconnected ()

Protected Attributes

bool _disconnected
u8_fragment_buffer [NUM_STREAMS]
u32 _fragment_length [NUM_STREAMS]
u32 _fragment_offset [NUM_STREAMS]
volatile bool _got_reliable [NUM_STREAMS]
u32 _max_payload_bytes
u32 _next_recv_expected_id [NUM_STREAMS]
u32 _next_send_id [NUM_STREAMS]
Mutex _recv_lock
RecvQueue_recv_queue_head [NUM_STREAMS]
RecvQueue_recv_queue_tail [NUM_STREAMS]
u32 _rtt
u8_send_buffer
u32 _send_buffer_ack_id
u32 _send_buffer_bytes
u32 _send_buffer_msg_count
u32 _send_buffer_stream
Mutex _send_lock
u32 _send_next_remote_expected [NUM_STREAMS]
SendQueue_send_queue_head [NUM_STREAMS]
SendQueue_send_queue_tail [NUM_STREAMS]
SendQueue_sent_list_head [NUM_STREAMS]
SendQueue_sent_list_tail [NUM_STREAMS]

Static Protected Attributes

static const u8 BHI_MASK = 7
static const u8 BHI_SINGLE_MESSAGE = 7
static const u32 FRAG_MAX = 65535
static const u32 FRAG_MIN = 0
static const u32 FRAG_THRESHOLD = 32
static const u8 I_MASK = 1 << 3
static const u32 IPV4_HEADER_BYTES = 20 + IPV4_OPTIONS_BYTES
static const u32 IPV4_OPTIONS_BYTES = 40
static const u32 IPV6_HEADER_BYTES = 40 + IPV6_OPTIONS_BYTES
static const u32 IPV6_OPTIONS_BYTES = 40
static const u32 MAX_MESSAGE_DATALEN = 65535-1
static const u32 MAXIMUM_MTU = 1500
static const u32 MEDIUM_MTU = 1400
static const u32 MIN_RTT = 50
static const u32 MINIMUM_MTU = 576
static const u32 NUM_STREAMS = 4
static const u8 R_MASK = 1 << 4
static const int SILENCE_LIMIT = 9333
static const u32 SOP_SHIFT = 5
static const int TICK_RATE = 20
static const int TIMEOUT_DISCONNECT = 15000
static const u32 UDP_HEADER_BYTES = 8

Private Member Functions

void CombineNextWrite ()
void OnACK (u8 *data, u32 data_bytes)
void OnFragment (ThreadPoolLocalStorage *tls, u8 *data, u32 bytes, u32 stream)
void OnMTUSet (u8 *data, u32 data_bytes)
void QueueRecv (ThreadPoolLocalStorage *tls, u8 *data, u32 bytes, u32 ack_id, u32 stream, u32 super_opcode)
void Retransmit (u32 stream, SendQueue *node, u32 now)
void RunQueue (ThreadPoolLocalStorage *tls, u32 ack_id, u32 stream)
void TransmitQueued ()
void WriteACK ()

Detailed Description

Definition at line 315 of file SphynxTransport.hpp.


Constructor & Destructor Documentation

cat::sphynx::Transport::Transport ( )
virtual cat::sphynx::Transport::~Transport ( ) [virtual]

Member Function Documentation

void cat::sphynx::Transport::CombineNextWrite ( ) [private]
void cat::sphynx::Transport::FlushWrite ( )
void cat::sphynx::Transport::InitializePayloadBytes ( bool  ip6)
CAT_INLINE bool cat::sphynx::Transport::IsDisconnected ( ) [inline, protected]

Definition at line 425 of file SphynxTransport.hpp.

References _disconnected.

{ return _disconnected; }
void cat::sphynx::Transport::OnACK ( u8 data,
u32  data_bytes 
) [private]
void cat::sphynx::Transport::OnDatagram ( ThreadPoolLocalStorage tls,
u8 data,
u32  bytes 
) [protected]
virtual void cat::sphynx::Transport::OnDisconnect ( ) [protected, pure virtual]

Implemented in cat::sphynx::Client.

void cat::sphynx::Transport::OnFragment ( ThreadPoolLocalStorage tls,
u8 data,
u32  bytes,
u32  stream 
) [private]
virtual void cat::sphynx::Transport::OnMessage ( ThreadPoolLocalStorage tls,
BufferStream  msg,
u32  bytes 
) [protected, pure virtual]

Implemented in cat::sphynx::Client.

void cat::sphynx::Transport::OnMTUSet ( u8 data,
u32  data_bytes 
) [private]
virtual void cat::sphynx::Transport::OnTimestampDeltaUpdate ( u32  rtt,
s32  delta 
) [inline, protected, virtual]

Reimplemented in cat::sphynx::Client.

Definition at line 438 of file SphynxTransport.hpp.

{}
bool cat::sphynx::Transport::PostDisconnect ( ) [protected]
bool cat::sphynx::Transport::PostMTUProbe ( ThreadPoolLocalStorage tls,
u16  payload_bytes 
) [protected]
virtual bool cat::sphynx::Transport::PostPacket ( u8 data,
u32  buf_bytes,
u32  msg_bytes,
u32  skip_bytes 
) [protected, pure virtual]
bool cat::sphynx::Transport::PostTimePing ( ) [protected]
bool cat::sphynx::Transport::PostTimePong ( u32  client_ts) [protected]
void cat::sphynx::Transport::QueueRecv ( ThreadPoolLocalStorage tls,
u8 data,
u32  bytes,
u32  ack_id,
u32  stream,
u32  super_opcode 
) [private]
void cat::sphynx::Transport::Retransmit ( u32  stream,
SendQueue node,
u32  now 
) [private]
void cat::sphynx::Transport::RunQueue ( ThreadPoolLocalStorage tls,
u32  ack_id,
u32  stream 
) [private]
void cat::sphynx::Transport::TickTransport ( ThreadPoolLocalStorage tls,
u32  now 
) [protected]
void cat::sphynx::Transport::TransmitQueued ( ) [private]
CAT_INLINE void cat::sphynx::Transport::TransportDisconnected ( ) [inline, protected]

Definition at line 424 of file SphynxTransport.hpp.

References _disconnected.

{ _disconnected = true; }
void cat::sphynx::Transport::WriteACK ( ) [private]
bool cat::sphynx::Transport::WriteReliable ( StreamMode  ,
u8  msg_opcode,
const void *  msg_data = 0,
u32  data_bytes = 0,
SuperOpcode  super_opcode = SOP_DATA 
)
bool cat::sphynx::Transport::WriteUnreliable ( u8  msg_opcode,
const void *  msg_data = 0,
u32  data_bytes = 0 
)

Member Data Documentation

Definition at line 403 of file SphynxTransport.hpp.

Referenced by IsDisconnected(), and TransportDisconnected().

Definition at line 364 of file SphynxTransport.hpp.

Definition at line 365 of file SphynxTransport.hpp.

Definition at line 366 of file SphynxTransport.hpp.

Definition at line 360 of file SphynxTransport.hpp.

Definition at line 350 of file SphynxTransport.hpp.

Definition at line 357 of file SphynxTransport.hpp.

Definition at line 383 of file SphynxTransport.hpp.

Definition at line 361 of file SphynxTransport.hpp.

Definition at line 372 of file SphynxTransport.hpp.

Definition at line 372 of file SphynxTransport.hpp.

Definition at line 386 of file SphynxTransport.hpp.

Definition at line 392 of file SphynxTransport.hpp.

Definition at line 394 of file SphynxTransport.hpp.

Definition at line 393 of file SphynxTransport.hpp.

Definition at line 395 of file SphynxTransport.hpp.

Definition at line 394 of file SphynxTransport.hpp.

Definition at line 380 of file SphynxTransport.hpp.

Definition at line 389 of file SphynxTransport.hpp.

Definition at line 398 of file SphynxTransport.hpp.

Definition at line 398 of file SphynxTransport.hpp.

Definition at line 401 of file SphynxTransport.hpp.

Definition at line 401 of file SphynxTransport.hpp.

const u8 cat::sphynx::Transport::BHI_MASK = 7 [static, protected]

Definition at line 318 of file SphynxTransport.hpp.

const u8 cat::sphynx::Transport::BHI_SINGLE_MESSAGE = 7 [static, protected]

Definition at line 319 of file SphynxTransport.hpp.

const u32 cat::sphynx::Transport::FRAG_MAX = 65535 [static, protected]

Definition at line 369 of file SphynxTransport.hpp.

const u32 cat::sphynx::Transport::FRAG_MIN = 0 [static, protected]

Definition at line 368 of file SphynxTransport.hpp.

const u32 cat::sphynx::Transport::FRAG_THRESHOLD = 32 [static, protected]

Definition at line 344 of file SphynxTransport.hpp.

const u8 cat::sphynx::Transport::I_MASK = 1 << 3 [static, protected]

Definition at line 320 of file SphynxTransport.hpp.

Definition at line 340 of file SphynxTransport.hpp.

const u32 cat::sphynx::Transport::IPV4_OPTIONS_BYTES = 40 [static, protected]

Definition at line 339 of file SphynxTransport.hpp.

Definition at line 337 of file SphynxTransport.hpp.

const u32 cat::sphynx::Transport::IPV6_OPTIONS_BYTES = 40 [static, protected]

Definition at line 336 of file SphynxTransport.hpp.

const u32 cat::sphynx::Transport::MAX_MESSAGE_DATALEN = 65535-1 [static, protected]

Definition at line 346 of file SphynxTransport.hpp.

const u32 cat::sphynx::Transport::MAXIMUM_MTU = 1500 [static, protected]

Definition at line 334 of file SphynxTransport.hpp.

const u32 cat::sphynx::Transport::MEDIUM_MTU = 1400 [static, protected]

Definition at line 333 of file SphynxTransport.hpp.

const u32 cat::sphynx::Transport::MIN_RTT = 50 [static, protected]

Definition at line 325 of file SphynxTransport.hpp.

const u32 cat::sphynx::Transport::MINIMUM_MTU = 576 [static, protected]

Definition at line 332 of file SphynxTransport.hpp.

const u32 cat::sphynx::Transport::NUM_STREAMS = 4 [static, protected]

Definition at line 324 of file SphynxTransport.hpp.

const u8 cat::sphynx::Transport::R_MASK = 1 << 4 [static, protected]

Definition at line 321 of file SphynxTransport.hpp.

const int cat::sphynx::Transport::SILENCE_LIMIT = 9333 [static, protected]

Definition at line 328 of file SphynxTransport.hpp.

const u32 cat::sphynx::Transport::SOP_SHIFT = 5 [static, protected]

Definition at line 322 of file SphynxTransport.hpp.

const int cat::sphynx::Transport::TICK_RATE = 20 [static, protected]

Definition at line 330 of file SphynxTransport.hpp.

const int cat::sphynx::Transport::TIMEOUT_DISCONNECT = 15000 [static, protected]

Definition at line 327 of file SphynxTransport.hpp.

const u32 cat::sphynx::Transport::UDP_HEADER_BYTES = 8 [static, protected]

Definition at line 342 of file SphynxTransport.hpp.


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

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net