Class Hierarchy   Class Index   Method Index  

CHMmfcSocketTransport Class Reference

#include <CHMmfcSocketTransport.h>

Inheritance diagram for CHMmfcSocketTransport:

CHMtransport

Detailed Description

MFC socket implementation of CHMtransport.

This implementation of CHMtransport inherits from the MFC CSocket class to provide a TCP/IP transport layer. See the on-line help for CSocket in your MFC guide for documentation.

Deprecated:


Public Member Functions

 CHMmfcSocketTransport ()
 Constructor.
virtual ~CHMmfcSocketTransport ()
 Destructor.
virtual void Close ()
 Close the connection.
virtual BOOL Connect (LPCTSTR Host, UINT PortNumber)
 Connect to Host on port PortNumber.
virtual void OnReceive (int nErrorCode)
 Error on receive.
virtual void OnAccept (int nErrorCode)
 Error on accept.
virtual void OnClose (int nErrorCode)
 Error on close.
virtual void SendMessage (const CHMstring &Data)
 Send a message.
virtual void SendResponseMessage (const CHMstring &MessageData, size_t TransportIndex)
 Send a response message.
const size_t & TransportIndex () const
 Get the transport index of this transport object.


Constructor & Destructor Documentation

CHMmfcSocketTransport::CHMmfcSocketTransport  ) 
 

Constructor.

After construction it is still necessary to call the Create function. See the on-line help for CSocket in MSDN.

virtual CHMmfcSocketTransport::~CHMmfcSocketTransport  )  [virtual]
 

Destructor.


Member Function Documentation

virtual void CHMmfcSocketTransport::Close  )  [virtual]
 

Close the connection.

virtual BOOL CHMmfcSocketTransport::Connect LPCTSTR  Host,
UINT  PortNumber
[virtual]
 

Connect to Host on port PortNumber.

virtual void CHMmfcSocketTransport::OnAccept int  nErrorCode  )  [virtual]
 

Error on accept.

virtual void CHMmfcSocketTransport::OnClose int  nErrorCode  )  [virtual]
 

Error on close.

virtual void CHMmfcSocketTransport::OnReceive int  nErrorCode  )  [virtual]
 

Error on receive.

virtual void CHMmfcSocketTransport::SendMessage const CHMstring Data  )  [virtual]
 

Send a message.

This method is used by the CHMwrapper class to initiate a client connection to a server by sending it a message.

virtual void CHMmfcSocketTransport::SendResponseMessage const CHMstring MessageData,
size_t  TransportIndex
[virtual]
 

Send a response message.

This method is called by the CHMwrapper class to send the response back to the counter party which is indexed using TransportIndex.

Implements CHMtransport.

const size_t& CHMmfcSocketTransport::TransportIndex  )  const
 

Get the transport index of this transport object.

For the main server socket this method will return 0. For the child sockets it will be 1, 2, 3, etc.


The documentation for this class was generated from the following file: