Download Source Code

CNetMsg Class Reference

Encapsulates network messaging. More...

#include <NetMsg.h>

Inheritance diagram for CNetMsg:

Inheritance graph
[legend]
Collaboration diagram for CNetMsg:

Collaboration graph
[legend]
List of all members.

Public Types

enum  
 Want update notification.
enum  
 Want update notification.
enum  
 If the item is a reply message.
enum  
 Update notification.
enum  
 Mask off special flags in command.
enum  
 Mask off all flags.

Public Member Functions

GUID * Address ()
 Returns a pointer to the current address.
 operator GUID * ()
 Returns a pointer to the current address.
virtual BOOL ReadPacket (LPVOID pBuf, DWORD dwSize)
 Reads raw serial data from the incomming data port.
virtual BOOL VerifyPacket ()
 Returns Non-zero if there is currently a valid packet in the buffer.
virtual BOOL OnWrite ()
 Called when new raw data is ready to be written.
 CNetMsg ()
 Default constructor.
virtual ~CNetMsg ()
 Destructor.
LPCTSTR GetConnectionName ()
 Retrieves the connection name (usually ip address or com port).
void SetConnectionName (LPCTSTR pName)
 Sets the connection name (usually ip address or com port).
const GUID * GetConnectionId ()
 Returns the connection ID.
void GetConnectionId (GUID *pGuid)
 Returns the connection ID.
void SetConnectionId (const GUID *pGuid)
 Sets the connection ID.
void SetConnectionDescription (LPCTSTR pDescription)
 Sets the connection description.
LPCTSTR GetConnectionDescription ()
 Returns the connection description.

Classes

struct  SAddress
 This structure contains address and class information. More...
struct  SConnection
 This structure carries information that uniquely identifies a client connection. More...
struct  SMsg
 This structure carries information about a particular message. More...

Detailed Description

Encapsulates network messaging.

This class wraps message data into packets for sending over the network layer. It also decodeds and verifys incomming data and prepares the data for dispatching.


Member Function Documentation

LPCTSTR CNetMsg::GetConnectionDescription  )  [inline]
 

Returns the connection description.

This can be the value set by SetConnectionDescription(), or may be the value received from the remote host. Depends on this being a transmitter or receiver.

Returns:
Pointer to the connection description
See also:

void CNetMsg::GetConnectionId GUID *  pGuid  )  [inline]
 

Returns the connection ID.

Parameters:
[out] pGuid - Receives the connection ID
Returns:
See also:

BOOL CNetMsg::OnWrite  )  [virtual]
 

Called when new raw data is ready to be written.

In response to this function, you should read data from the transmit buffer ( call Tx() ), and send it to the remote connection. The read data is completely formatted and ready to be processed by the corrisponding ReadPacket() function on the remote connection.

Returns:
Non-zero if success
See also:

Reimplemented from CCircBuf.

BOOL CNetMsg::ReadPacket LPVOID  pBuf,
DWORD  dwSize
[virtual]
 

Reads raw serial data from the incomming data port.

Parameters:
[in] pBuf - Raw serial data
[in] dwSize - Number of bytes in pBuf
When data is received, such as from a socket, call this function to process the data. De-serializing, message dispatch, etc... is all handled by this function.

Returns:
Non-zero if success
See also:

Reimplemented from CDataPacket.

void CNetMsg::SetConnectionDescription LPCTSTR  pDescription  )  [inline]
 

Sets the connection description.

Parameters:
[in] pDescription - Description sent to remote host

void CNetMsg::SetConnectionId const GUID *  pGuid  )  [inline]
 

Sets the connection ID.

Parameters:
[in] pGuid - Connection ID


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