Serial Framework C++ Edition
Public Member Functions | Protected Member Functions | List of all members
CwclClientConnection Class Referenceabstract

The base class for all client oriented connections. More...

#include <wclConnections.h>

Inheritance diagram for CwclClientConnection:
CwclCustomConnection CwclClientDataConnection

Public Member Functions

 CwclClientConnection ()
 Creates a new client connection.
 
virtual ~CwclClientConnection ()
 Frees the connection.
 
int Connect (const unsigned long Timeout=10000)
 Connects to a remote device.
 
int Disconnect ()
 Disconnects from the connected remote device.
 
wclClientState GetState () const
 Gets the connection state.
 
 __declspec (property(get=GetState)) wclClientState State
 Gets the connection state.
 
unsigned long GetTimeout () const
 Gets the connect timeout value.
 
 __declspec (property(get=GetTimeout)) unsigned long Timeout
 Gets the connect timeout value.
 
__event void OnConnect (void *Sender, const int Error)
 The event fires when a connection to a remote device has been completed (with or without success).
 
__event void OnDisconnect (void *Sender, const int Reason)
 The event fires when the remote connected device has been disconnected.
 
- Public Member Functions inherited from CwclCustomConnection
 CwclCustomConnection ()
 Creates a new connection.
 
virtual ~CwclCustomConnection ()
 Frees the connection.
 
CwclMessageReceiverGetReceiver () const
 Gets the connection message receiver object.
 
 __declspec (property(get=GetReceiver)) CwclMessageReceiver *Receiver
 Gets the connection message receiver object.
 
DWORD GetThreadId () const
 Gets the connection's thread ID.
 
 __declspec (property(get=GetThreadId)) DWORD ThreadId
 Gets the connection's thread ID.
 

Protected Member Functions

void InternalDisconnect (const int Reason)
 The internal disconnect method. Disconnects from a connected remote device.
 
void NotifyClosed (const int Reason)
 Send a Disconnect notification message.
 
virtual void MessageReceived (const CwclMessage *const Message) override
 The message receiver calls this method when a new notification message has been received.
 
virtual void DoConnect (const int Error)
 Fires the OnConnect event.
 
virtual void DoDisconnect (const int Reason)
 Fires the OnDisconnect event.
 
virtual int HalCommunicate (const HANDLE Event)
 Implements a hardware-dependent code that communicate with the connected remote device.
 
virtual int HalConnect (const HANDLE Event)=0
 Implements a hardware-dependent code that connects to a remote device.
 
virtual int HalDisconnect ()=0
 Implements a hardware-dependent code that disconnects from the connected remote device.
 
- Protected Member Functions inherited from CwclCustomConnection
virtual void MessageReceived (const CwclMessage *const Message)
 The message receiver calls this method when a new notification message has been received.
 
void Enter ()
 Enters the connection's critical section.
 
void Leave ()
 Exists *leaves) the connection's critical section.
 

Detailed Description

The base class for all client oriented connections.

The class provides the basic methods for client connections.

See also
CwclCustomConnection