Download Source Code

CNetCom Class Reference

Basic network communication class. More...

#include <NetCom.h>

Inheritance diagram for CNetCom:

Inheritance graph
[legend]
Collaboration diagram for CNetCom:

Collaboration graph
[legend]
List of all members.

Public Member Functions

BOOL GetParamsHash (GUID *pGuid)
 Gets the hash value of last passed parameter list.
BOOL VerifyParams (const GUID *pGuid)
 Verifies the hash of the last sent parameter list.
BOOL GetParams (CReg *pParams, GUID *pGuid=NULL)
 Copies the parameter list from the last received command.
long OnNetMsg (WPARAM wParam, LPARAM lParam)
 Resolved callback function that handles network notifications.
virtual BOOL OnRx ()
 Called when new data is received from the network.
virtual BOOL OnTx ()
 Called when the transmit buffer is empty and is able to receive more data.
virtual BOOL IsValid ()
 Returns non-zero if this object is valid.
 CNetCom (CNetMsg *pRx=NULL, CNetMsg *pTx=NULL)
 Constructs a network communication object.
virtual ~CNetCom ()
 Destructor.
CNetMsg::SAddressGetDst ()
 Returns the address of the destination session.
CNetMsg::SAddressGetSrc ()
 Returns the address of the source session.
CNetMsgRx ()
 Returns a pointer to the receiver messenger.
CNetMsgTx ()
 Returns a pointer to the transmitter messenger.
CNetMsg::SConnectionConn ()
 Returns a reference connection information structure.
CNetMsg::SMsgSMsg ()
 Returns the message information data structure.
virtual CNetComGetNode (const GUID *pGuid)
 Return a valid CNetCom*, in this case, the this pointer.
virtual CNetComFindByRxName (LPCTSTR pName)
 Return a valid CNetCom*, in this case, the this pointer.
virtual CNetComFindByTxName (LPCTSTR pName)
 Return a valid CNetCom*, in this case, the this pointer.
virtual BOOL OnInitSession ()
 Over-ride to provide custom initialization.
virtual BOOL Disconnect ()
 Over-ride and implement a disconnect.

Static Public Member Functions

static long NetMsg (LPVOID pData, WPARAM wParam, LPARAM lParam)
 Callback function that handles network notifications.

Protected Attributes

CNetMsgm_prx
 Delete in destructor if custom type then set to NULL.
CNetMsgm_ptx
 Delete in destructor if custom type then set to NULL.

Detailed Description

Basic network communication class.

Binds the receive and transmit portions of the network layer.


Constructor & Destructor Documentation

CNetCom::CNetCom CNetMsg pRx = NULL,
CNetMsg pTx = NULL
 

Constructs a network communication object.

Parameters:
[in] pRx - Receiver messenger object NULL for default
[in] pTx - Transmiter messenger object NULL for default
Returns:
See also:


Member Function Documentation

virtual BOOL CNetCom::Disconnect  )  [inline, virtual]
 

Over-ride and implement a disconnect.

Returns:
Non-zero if success
See also:

virtual CNetCom* CNetCom::FindByRxName LPCTSTR  pName  )  [inline, virtual]
 

Return a valid CNetCom*, in this case, the this pointer.

Parameters:
[in] pName - Session name
Return a pointer to a matching CNetCom object.

Returns:
Pointer to a CNetCom object
See also:

Implements CNetCmd.

virtual CNetCom* CNetCom::FindByTxName LPCTSTR  pName  )  [inline, virtual]
 

Return a valid CNetCom*, in this case, the this pointer.

Parameters:
[in] pName - Session name
Return a pointer to a matching CNetCom object.

Returns:
Pointer to a CNetCom object
See also:

Implements CNetCmd.

virtual CNetCom* CNetCom::GetNode const GUID *  pGuid  )  [inline, virtual]
 

Return a valid CNetCom*, in this case, the this pointer.

Parameters:
[in] pGuid - Session ID
Return a pointer to a matching CNetCom object.

Returns:
Pointer to a CNetCom object
See also:

Implements CNetCmd.

BOOL CNetCom::GetParams CReg pParams,
GUID *  pGuid = NULL
 

Copies the parameter list from the last received command.

Parameters:
[in] pParams - Receives the parameter list
[in] pGuid - Receives the parameter list hash Can be NULL
Returns:
Non-zero if success
See also:

BOOL CNetCom::GetParamsHash GUID *  pGuid  ) 
 

Gets the hash value of last passed parameter list.

Parameters:
[out] pGuid - Receives the hash
Returns:
Non-zero if success
See also:

virtual BOOL CNetCom::IsValid  )  [inline, virtual]
 

Returns non-zero if this object is valid.

Warning:
Returning zero from this function may cause this object to be promptly destroyed by the network manager.

long CNetCom::NetMsg LPVOID  pData,
WPARAM  wParam,
LPARAM  lParam
[static]
 

Callback function that handles network notifications.

Parameters:
[in] pData - CNetCom class pointer
[in] wParam - Message WPARAM value
[in] lParam - Message LPARAM value
Returns:
Message return value
See also:

BOOL CNetCom::OnInitSession  )  [virtual]
 

Over-ride to provide custom initialization.

You should always call the base class implementation unless you have specific reasons for not doing it.

Returns:
Non-zero if successful initialization
See also:

long CNetCom::OnNetMsg WPARAM  wParam,
LPARAM  lParam
 

Resolved callback function that handles network notifications.

Parameters:
[in] wParam - Message WPARAM value
[in] lParam - Message LPARAM value
Called by NetMsg()

Returns:
Message return value
See also:
NetMsg()

BOOL CNetCom::OnRx  )  [virtual]
 

Called when new data is received from the network.

Returns:
Non-zero if success
See also:

virtual BOOL CNetCom::OnTx  )  [inline, virtual]
 

Called when the transmit buffer is empty and is able to receive more data.

Returns:
Non-zero if success
See also:

BOOL CNetCom::VerifyParams const GUID *  pGuid  ) 
 

Verifies the hash of the last sent parameter list.

Parameters:
[out] pGuid - Receives the hash
Returns:
Non-zero if parameters are valid
See also:


The documentation for this class was generated from the following files:
  • inc/NetCom.h
  • NetCom.cpp
Copyright Robert Umbehant
This documentation is covered by the LGPL