Lugre::cConnection Class Reference

#include <lugre_net.h>

Inheritance diagram for Lugre::cConnection:

Inheritance graph
[legend]
Collaboration diagram for Lugre::cConnection:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 cConnection ()
 local connection, master
 cConnection (cConnection *con)
 local connection, slave
 cConnection (const int iSocket, const char *szHost, const int iPort, const uint32 iRemoteAddr)
 outgoing connection
 cConnection (const int iSocket, const uint32 iRemoteAddr)
 incoming connection
virtual ~cConnection ()
void Init ()
void Close ()
 close the connection
void SendPush (cFIFO &source, const bool bWrite)
 for broadcast : attemp to send as much data as possible, and push the rest onto the outbuffer
void Step (const bool bRead, const bool bWrite, const bool bExcept)
bool IsLocal ()
const bool IsConnected ()
 check if the connection is still alive/connected

Public Attributes

int miSocket
std::string msHost
int miPort
cFIFOmpInBuffer
cFIFOmpOutBuffer
bool mbOwnBuffers
uint32 miRemoteAddr
unsigned char mIP [4]


Detailed Description

Definition at line 102 of file lugre_net.h.


Constructor & Destructor Documentation

Lugre::cConnection::cConnection (  ) 

local connection, master

Definition at line 257 of file lugre_net.cpp.

References Init(), and PROFILE.

Lugre::cConnection::cConnection ( cConnection con  ) 

local connection, slave

Definition at line 263 of file lugre_net.cpp.

References Init(), and PROFILE.

Lugre::cConnection::cConnection ( const int  iSocket,
const char *  szHost,
const int  iPort,
const uint32  iRemoteAddr 
)

outgoing connection

Definition at line 271 of file lugre_net.cpp.

References Init(), and PROFILE.

Lugre::cConnection::cConnection ( const int  iSocket,
const uint32  iRemoteAddr 
)

incoming connection

Definition at line 278 of file lugre_net.cpp.

References Init(), and PROFILE.

Lugre::cConnection::~cConnection (  )  [virtual]


Member Function Documentation

void Lugre::cConnection::Init (  ) 

void Lugre::cConnection::Close (  ) 

close the connection

Definition at line 297 of file lugre_net.cpp.

References Lugre::closesocket(), INVALID_SOCKET, miSocket, and PROFILE.

Referenced by ~cConnection().

void Lugre::cConnection::SendPush ( cFIFO source,
const bool  bWrite 
)

for broadcast : attemp to send as much data as possible, and push the rest onto the outbuffer

Definition at line 318 of file lugre_net.cpp.

References assert, Lugre::cNet::GetSingleton(), Lugre::cFIFO::HackGetRawReader(), INVALID_SOCKET, miSocket, Lugre::cNet::mlDyingCons, mpOutBuffer, PROFILE, Lugre::cFIFO::PushRaw(), and Lugre::cFIFO::size().

void Lugre::cConnection::Step ( const bool  bRead,
const bool  bWrite,
const bool  bExcept 
)

bool Lugre::cConnection::IsLocal (  ) 

Definition at line 306 of file lugre_net.cpp.

References INVALID_SOCKET, and miSocket.

const bool Lugre::cConnection::IsConnected (  ) 

check if the connection is still alive/connected

Definition at line 117 of file lugre_net.cpp.

References INVALID_SOCKET, and miSocket.


Member Data Documentation

Definition at line 104 of file lugre_net.h.

Referenced by Close(), IsConnected(), IsLocal(), SendPush(), and Step().

Definition at line 105 of file lugre_net.h.

Definition at line 106 of file lugre_net.h.

Definition at line 107 of file lugre_net.h.

Referenced by Init(), Step(), and ~cConnection().

Definition at line 108 of file lugre_net.h.

Referenced by Init(), SendPush(), Step(), and ~cConnection().

Definition at line 109 of file lugre_net.h.

Referenced by Init(), and ~cConnection().

Definition at line 110 of file lugre_net.h.

Referenced by Init().

unsigned char Lugre::cConnection::mIP[4]

Definition at line 111 of file lugre_net.h.

Referenced by Init().


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

Generated on Wed Feb 8 06:00:21 2012 for cpp by  doxygen 1.5.6