GClasses
GClasses::GTCPConnection Class Reference

Detailed Description

This class is used by GTCPServer to represent a connection with one of the clients. (If you want to associate some additional objects with each connection, you can inherrit from this class, and overload GTCPServer::makeConnection to return your own custom object.)

#include <GSocket.h>

Inheritance diagram for GClasses::GTCPConnection:
GClasses::GHttpConnection GClasses::GPackageConnection GClasses::GDynamicPageConnection

Public Member Functions

 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...
 

Protected Attributes

SOCKET m_sock
 

Constructor & Destructor Documentation

GClasses::GTCPConnection::GTCPConnection ( SOCKET  sock)
inline
virtual GClasses::GTCPConnection::~GTCPConnection ( )
inlinevirtual

Member Function Documentation

in_addr GClasses::GTCPConnection::ipAddr ( )

Returns the client's IP address for this connection. (You can use inet_ntoa to convert the value this returns to a string.)

void GClasses::GTCPConnection::setSocket ( SOCKET  sock)
inline

Sets the socket for this connection.

SOCKET GClasses::GTCPConnection::socket ( )
inline

Returns the socket associated with this connection.

Member Data Documentation

SOCKET GClasses::GTCPConnection::m_sock
protected