#include <lugre_net.h>


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 |
| cFIFO * | mpInBuffer |
| cFIFO * | mpOutBuffer |
| bool | mbOwnBuffers |
| uint32 | miRemoteAddr |
| unsigned char | mIP [4] |
Definition at line 102 of file lugre_net.h.
| Lugre::cConnection::cConnection | ( | ) |
| Lugre::cConnection::cConnection | ( | cConnection * | con | ) |
| Lugre::cConnection::cConnection | ( | const int | iSocket, | |
| const char * | szHost, | |||
| const int | iPort, | |||
| const uint32 | iRemoteAddr | |||
| ) |
| Lugre::cConnection::cConnection | ( | const int | iSocket, | |
| const uint32 | iRemoteAddr | |||
| ) |
| Lugre::cConnection::~cConnection | ( | ) | [virtual] |
Definition at line 308 of file lugre_net.cpp.
References Close(), Lugre::cNet::GetSingleton(), mbOwnBuffers, Lugre::cNet::mlCons, mpInBuffer, mpOutBuffer, and PROFILE.
| void Lugre::cConnection::Init | ( | ) |
Definition at line 284 of file lugre_net.cpp.
References Lugre::cNet::GetSingleton(), kConStartSpace, mbOwnBuffers, mIP, miRemoteAddr, Lugre::cNet::mlCons, mpInBuffer, mpOutBuffer, and PROFILE.
Referenced by cConnection().
| 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 | |||
| ) |
Definition at line 338 of file lugre_net.cpp.
References assert, Lugre::cNet::GetSingleton(), Lugre::cFIFO::HackAddLength(), Lugre::cFIFO::HackGetFreeSpace(), Lugre::cFIFO::HackGetRawReader(), Lugre::cFIFO::HackGetRawWriter(), INVALID_SOCKET, kConMinRecvSpace, miSocket, Lugre::cNet::mlDyingCons, mpInBuffer, mpOutBuffer, Lugre::cFIFO::PopRaw(), PROFILE, and Lugre::cFIFO::size().
| bool Lugre::cConnection::IsLocal | ( | ) |
| 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.
Definition at line 104 of file lugre_net.h.
Referenced by Close(), IsConnected(), IsLocal(), SendPush(), and Step().
| std::string Lugre::cConnection::msHost |
Definition at line 105 of file lugre_net.h.
Definition at line 106 of file lugre_net.h.
Definition at line 108 of file lugre_net.h.
Referenced by Init(), SendPush(), Step(), and ~cConnection().
| unsigned char Lugre::cConnection::mIP[4] |
1.5.6