Lugre::cNet Class Reference

#include <lugre_net.h>

List of all members.

Public Member Functions

void Step ()
 call this twice if using local connections, needs to recheck for read availability after writing
cConnectionConnect (const char *szHost, const int iPort)
 outgoing connection
cConnectionConnect (const unsigned int iHost, const int iPort)
cNetListenerListen (const int iPort)
cConnectionPopDeadCon ()
 cNet ()
 ~cNet ()

Static Public Member Functions

static cNetGetSingleton ()
static unsigned int GetHostByName (const char *szHost)
static int ConnectSocket (uint32 iIP, const int iPort)
static bool IsInvalidSocket (const int iSocket)
static void CloseSocket (const int iSocket)
static int Send (const int iSocket, const char *pBuffer, const int iBufferSize, const int iFlags)
static int Recv (const int iSocket, char *pBuffer, const int iBufferSize, const int iFlags)

Public Attributes

std::set< cNetListener * > mlListener
std::set< cConnection * > mlCons
std::set< cConnection * > mlDyingCons
std::set< cConnection * > mlDeadCons
std::set< cBroadcast * > mlBroadCasts


Detailed Description

Definition at line 65 of file lugre_net.h.


Constructor & Destructor Documentation

Lugre::cNet::cNet (  ) 

Definition at line 49 of file lugre_net.cpp.

References PROFILE.

Referenced by GetSingleton().

Lugre::cNet::~cNet (  ) 

Definition at line 56 of file lugre_net.cpp.

References mlCons, mlDeadCons, mlDyingCons, mlListener, and PROFILE.


Member Function Documentation

static cNet& Lugre::cNet::GetSingleton (  )  [inline, static]

void Lugre::cNet::Step (  ) 

call this twice if using local connections, needs to recheck for read availability after writing

Definition at line 67 of file lugre_net.cpp.

References INVALID_SOCKET, mlBroadCasts, mlCons, mlDeadCons, mlDyingCons, mlListener, PROFILE, Lugre::sSelectSet_Except, Lugre::sSelectSet_Read, and Lugre::sSelectSet_Write.

Referenced by Lugre::cConnection_L::NetReadAndWrite().

cConnection * Lugre::cNet::Connect ( const char *  szHost,
const int  iPort 
)

outgoing connection

Definition at line 200 of file lugre_net.cpp.

References ConnectSocket(), GetHostByName(), INVALID_SOCKET, and PROFILE.

Referenced by Lugre::cConnection_L::NetConnect().

cConnection* Lugre::cNet::Connect ( const unsigned int  iHost,
const int  iPort 
)

cNetListener * Lugre::cNet::Listen ( const int  iPort  ) 

Definition at line 211 of file lugre_net.cpp.

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

Referenced by Lugre::cNetListener_L::NetListen().

cConnection* Lugre::cNet::PopDeadCon (  ) 

unsigned int Lugre::cNet::GetHostByName ( const char *  szHost  )  [static]

resolves hostname to nummeric ip, 0 on error THREADSAFE (used by lugre_thread.cpp)

Definition at line 124 of file lugre_net.cpp.

References assert, and PROFILE.

Referenced by Connect(), Lugre::cConnection_L::GetHostByName(), and Lugre::cThread_NetRequestImpl::operator()().

int Lugre::cNet::ConnectSocket ( uint32  iIP,
const int  iPort 
) [static]

return INVALID_SOCKET on error THREADSAFE (used by lugre_thread.cpp)

Definition at line 165 of file lugre_net.cpp.

References INVALID_SOCKET, PROFILE, and SOCKET_ERROR.

Referenced by Connect(), and Lugre::cThread_NetRequestImpl::operator()().

bool Lugre::cNet::IsInvalidSocket ( const int  iSocket  )  [static]

Definition at line 190 of file lugre_net.cpp.

References INVALID_SOCKET.

Referenced by Lugre::cThread_NetRequestImpl::operator()().

void Lugre::cNet::CloseSocket ( const int  iSocket  )  [static]

Definition at line 191 of file lugre_net.cpp.

References Lugre::closesocket().

Referenced by Lugre::cThread_NetRequestImpl::operator()().

int Lugre::cNet::Send ( const int  iSocket,
const char *  pBuffer,
const int  iBufferSize,
const int  iFlags 
) [static]

Definition at line 192 of file lugre_net.cpp.

Referenced by Lugre::cThread_NetRequestImpl::operator()().

int Lugre::cNet::Recv ( const int  iSocket,
char *  pBuffer,
const int  iBufferSize,
const int  iFlags 
) [static]

Definition at line 195 of file lugre_net.cpp.

Referenced by Lugre::cThread_NetRequestImpl::operator()().


Member Data Documentation

Definition at line 69 of file lugre_net.h.

Referenced by Lugre::cConnection::SendPush(), Lugre::cConnection::Step(), Step(), and ~cNet().

Definition at line 70 of file lugre_net.h.

Referenced by Step(), and ~cNet().

Definition at line 71 of file lugre_net.h.

Referenced by Lugre::cBroadcast::cBroadcast(), and Step().


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