Download Source Code

CNetCmd Class Reference

Provides a network command interface. More...

#include <NetCmd.h>

Inheritance diagram for CNetCmd:

Inheritance graph
[legend]
Collaboration diagram for CNetCmd:

Collaboration graph
[legend]
List of all members.

Public Member Functions

BOOL LocalMsg (const GUID *pguidClass, DWORD dwFunction)
 Sends a message to local network objects.
BOOL NotifyDisconnect (long lError)
 Call to notify the network when this node dissconnects.
BOOL NotifyConnect (long lError)
 CNetCmd ()
 Default constructor.
virtual ~CNetCmd ()
 Desturctor.
virtual CNetComGetNode (const GUID *pGuid)=0
 Over-ride this function and return a valid CNetCom object.
virtual CNetComFindByRxName (LPCTSTR pName)=0
 Over-ride this function and return a valid CNetCom object.
virtual CNetComFindByTxName (LPCTSTR pName)=0
 Over-ride this function and return a valid CNetCom object.
BOOL vMsg (const GUID *pNode, const GUID *pClass, DWORD dwFunction=0, CReg *pParams=NULL, DWORD dwBuffers=0, LPVOID *pArgs=NULL)
 For sending messages to the connected node.
BOOL _cdecl Msg (const GUID *pNode, const GUID *pClass, DWORD dwFunction=0, CReg *pParams=NULL, DWORD dwBuffers=0,...)
 For sending messages to the connected node.
virtual BOOL OnRxAuthenticate (const GUID *pguidNode, const GUID *pguidClass, DWORD dwFunction)
 Over-ride to supply custom authentication.
virtual BOOL OnTxAuthenticate (const GUID *pguidNode, const GUID *pguidClass, DWORD dwFunction)
 Over-ride to supply custom authentication.
virtual BOOL NotifyNetwork (const GUID *pguidClass, DWORD dwCmd)
 Call this function to notify the network of a change.
long GetNetError ()
 Returns the last network error value.
void SetNetError (long lError)
 Sets the last network error value.
void ClearNetError ()
 Clears the last network error value.

Protected Attributes

long m_lError
 The last network error value.

Detailed Description

Provides a network command interface.

Formats commands for sending over the network layer.


Member Function Documentation

virtual CNetCom* CNetCmd::FindByRxName LPCTSTR  pName  )  [pure virtual]
 

Over-ride this function and return a valid CNetCom object.

Parameters:
[in] pName - Network session receiver (remote) name
Returns:
Pointer to valid CNetCom object or NULL if not found
See also:

Implemented in CNetCom, and CNetMgr.

virtual CNetCom* CNetCmd::FindByTxName LPCTSTR  pName  )  [pure virtual]
 

Over-ride this function and return a valid CNetCom object.

Parameters:
[in] pName - Network session transmitter (local) name
Returns:
Pointer to valid CNetCom object or NULL if not found
See also:

Implemented in CNetCom, and CNetMgr.

virtual CNetCom* CNetCmd::GetNode const GUID *  pGuid  )  [pure virtual]
 

Over-ride this function and return a valid CNetCom object.

Parameters:
[in] pGuid - Network session ID
Returns:
Pointer to valid CNetCom object or NULL if not found
See also:

Implemented in CNetCom, and CNetMgr.

BOOL CNetCmd::LocalMsg const GUID *  pguidClass,
DWORD  dwFunction
 

Sends a message to local network objects.

Parameters:
[in] pguidClass - Class ID
[in] dwFunction - Function ID
Returns:
Non-zero if success
See also:

BOOL _cdecl CNetCmd::Msg const GUID *  pNode,
const GUID *  pClass,
DWORD  dwFunction = 0,
CReg pParams = NULL,
DWORD  dwBuffers = 0,
  ...
[inline]
 

For sending messages to the connected node.

Parameters:
[in] pNode - Session ID
[in] pClass - Class ID
[in] dwFunction - Function ID
[in] pParams - Parameter list
[in] dwBuffers - Number of buffer arguments
[in] ... ... = ( DWORD dwType, LPBYTE pPtr, DWORD dwSize, ... )
  • dwType = Data buffer type
  • pPtr = Pointer to data buffer
  • dwSize = Number of bytes in pPtr

Returns:
Non-zero if success
See also:

BOOL CNetCmd::NotifyConnect long  lError  ) 
 

Parameters:
[in] lError - Error code, zero if no error
Returns:
Non-zero if success
See also:

BOOL CNetCmd::NotifyDisconnect long  lError  ) 
 

Call to notify the network when this node dissconnects.

Parameters:
[in] lError - Error code
Returns:
Non-zero if success
See also:

virtual BOOL CNetCmd::NotifyNetwork const GUID *  pguidClass,
DWORD  dwCmd
[inline, virtual]
 

Call this function to notify the network of a change.

Parameters:
[in] pguidClass - Class ID that has changed
[in] dwCmd - Command ID that has changed
This informs any class that requested change notifications that a change to the specified value has taken place. It is then up to that class to query the new value or not.

Returns:
Non-zero if success
See also:

Reimplemented in CNetMgr.

virtual BOOL CNetCmd::OnRxAuthenticate const GUID *  pguidNode,
const GUID *  pguidClass,
DWORD  dwFunction
[inline, virtual]
 

Over-ride to supply custom authentication.

Parameters:
[in] pguidNode - Session ID
[in] pguidClass - Class ID
[in] dwFunction - Function
Returns:
Non-zero to allow connection
See also:

virtual BOOL CNetCmd::OnTxAuthenticate const GUID *  pguidNode,
const GUID *  pguidClass,
DWORD  dwFunction
[inline, virtual]
 

Over-ride to supply custom authentication.

Parameters:
[in] pguidNode - Session ID
[in] pguidClass - Class ID
[in] dwFunction - Function
Returns:
Non-zero to allow connection
See also:

BOOL CNetCmd::vMsg const GUID *  pNode,
const GUID *  pClass,
DWORD  dwFunction = 0,
CReg pParams = NULL,
DWORD  dwBuffers = 0,
LPVOID *  pArgs = NULL
 

For sending messages to the connected node.

Parameters:
[in] pNode - Session ID
[in] pClass - Class ID
[in] dwFunction - Function ID
[in] pParams - Parameter list
[in] dwBuffers - Number of buffer arguments
[in] pArgs - Pointer to buffer arguments
pArgs = ( DWORD dwType, LPBYTE pPtr, DWORD dwSize, ... )

  • dwType = Data buffer type
  • pPtr = Pointer to data buffer
  • dwSize = Number of bytes in pPtr

Returns:
Non-zero if success
See also:


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