#include <lugre_net.h>
Public Member Functions | |
| void | Step () |
| call this twice if using local connections, needs to recheck for read availability after writing | |
| cConnection * | Connect (const char *szHost, const int iPort) |
| outgoing connection | |
| cConnection * | Connect (const unsigned int iHost, const int iPort) |
| cNetListener * | Listen (const int iPort) |
| cConnection * | PopDeadCon () |
| cNet () | |
| ~cNet () | |
Static Public Member Functions | |
| static cNet & | GetSingleton () |
| 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 |
Definition at line 65 of file lugre_net.h.
| Lugre::cNet::cNet | ( | ) |
| Lugre::cNet::~cNet | ( | ) |
Definition at line 56 of file lugre_net.cpp.
References mlCons, mlDeadCons, mlDyingCons, mlListener, and PROFILE.
| static cNet& Lugre::cNet::GetSingleton | ( | ) | [inline, static] |
Definition at line 73 of file lugre_net.h.
References cNet().
Referenced by Lugre::cBroadcast::cBroadcast(), Lugre::cNetListener::cNetListener(), Lugre::cConnection::Init(), Lugre::cConnection_L::NetConnect(), Lugre::cNetListener_L::NetListen(), Lugre::cConnection_L::NetReadAndWrite(), Lugre::cConnection::SendPush(), Lugre::cConnection::Step(), Lugre::cConnection::~cConnection(), and Lugre::cNetListener::~cNetListener().
| 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()().
| std::set<cNetListener*> Lugre::cNet::mlListener |
Definition at line 67 of file lugre_net.h.
Referenced by Lugre::cNetListener::cNetListener(), Step(), ~cNet(), and Lugre::cNetListener::~cNetListener().
| std::set<cConnection*> Lugre::cNet::mlCons |
Definition at line 68 of file lugre_net.h.
Referenced by Lugre::cConnection::Init(), Step(), Lugre::cConnection::~cConnection(), and ~cNet().
| std::set<cConnection*> Lugre::cNet::mlDyingCons |
Definition at line 69 of file lugre_net.h.
Referenced by Lugre::cConnection::SendPush(), Lugre::cConnection::Step(), Step(), and ~cNet().
| std::set<cConnection*> Lugre::cNet::mlDeadCons |
| std::set<cBroadcast*> Lugre::cNet::mlBroadCasts |
Definition at line 71 of file lugre_net.h.
Referenced by Lugre::cBroadcast::cBroadcast(), and Step().
1.5.6