This is a helper class used by GPackageServer. If you implement a custom connection object for a sub-class of GPackageServer, then it should inherrit from this class.
More...
#include <GSocket.h>
|
| GPackageConnection (SOCKET sock) |
|
virtual | ~GPackageConnection () |
|
char * | next (size_t *pOutSize) |
| Returns the next ready package. Returns NULL if no complete package is ready. More...
|
|
int | receive (unsigned int maxBufSize, unsigned int maxPackageSize) |
| Receives any available incoming data and adds it to the queue when a complete package is received. Returns 0 if no errors occur (whether or not a full package was received). Returns 1 if the other end disconnected. Returns 2 if the other end tried to send a package that was too big. Returns 3 if the other end breached protocol by sending a bad header. More...
|
|
| GTCPConnection (SOCKET sock) |
|
virtual | ~GTCPConnection () |
|
in_addr | ipAddr () |
| Returns the client's IP address for this connection. (You can use inet_ntoa to convert the value this returns to a string.) More...
|
|
void | setSocket (SOCKET sock) |
| Sets the socket for this connection. More...
|
|
SOCKET | socket () |
| Returns the socket associated with this connection. More...
|
|
This is a helper class used by GPackageServer. If you implement a custom connection object for a sub-class of GPackageServer, then it should inherrit from this class.
GClasses::GPackageConnection::GPackageConnection |
( |
SOCKET |
sock | ) |
|
|
inline |
virtual GClasses::GPackageConnection::~GPackageConnection |
( |
| ) |
|
|
inlinevirtual |
char* GClasses::GPackageConnection::next |
( |
size_t * |
pOutSize | ) |
|
Returns the next ready package. Returns NULL if no complete package is ready.
int GClasses::GPackageConnection::receive |
( |
unsigned int |
maxBufSize, |
|
|
unsigned int |
maxPackageSize |
|
) |
| |
Receives any available incoming data and adds it to the queue when a complete package is received. Returns 0 if no errors occur (whether or not a full package was received). Returns 1 if the other end disconnected. Returns 2 if the other end tried to send a package that was too big. Returns 3 if the other end breached protocol by sending a bad header.
unsigned int GClasses::GPackageConnection::m_bufSize |
unsigned int GClasses::GPackageConnection::m_header[2] |
unsigned int GClasses::GPackageConnection::m_headerBytes |
unsigned int GClasses::GPackageConnection::m_payloadBytes |
char* GClasses::GPackageConnection::m_pBuf |
char* GClasses::GPackageConnection::m_pCondemned |