|
Serial Framework C++ Edition
|
The base class for the server connection that requires data exchange with a remote device. More...
#include <wclConnections.h>
Public Member Functions | |
| CwclServerDataConnection () | |
| Creates a new client data connection. | |
| __event void | OnData (void *Sender, CwclServerClientDataConnection *const Client, const void *const Data, const unsigned long Size) |
| The event fires when new data is received from the connected remote device. | |
Public Member Functions inherited from CwclServerConnection | |
| CwclServerConnection () | |
| Creates a new server connection. | |
| virtual | ~CwclServerConnection () |
| Frees the server connection. | |
| int | Close () |
| The method disconnects all connected clients and closes the server. | |
| int | Listen (const wclMessageProcessingMethod MessageProcessing) |
| The method starts listening for client connections. | |
| CwclServerClientConnection * | GetClients (const size_t Index) const |
| Gets a connected client by its index. | |
| __declspec (property(get=GetClients)) CwclServerClientConnection *Clients[] | |
| Gets a connected client by its index. | |
| size_t | GetClientsCount () const |
| Gets the number of connected clients. | |
| __declspec (property(get=GetClientsCount)) size_t ClientsCount | |
| Gets the number of connected clients. | |
| wclServerState | GetState () const |
| Gets the connection state. | |
| __declspec (property(get=GetState)) wclServerState State | |
| Gets the connection state. | |
| __event void | OnClosed (void *Sender, const int Reason) |
| The event fires when the server is closed. | |
| __event void | OnConnect (void *Sender, CwclServerClientConnection *const Client, const int Error) |
| The event fires when a remote client is connected to the server. | |
| __event void | OnDisconnect (void *Sender, CwclServerClientConnection *const Client, const int Reason) |
| The event fires when a remote client has disconnected from the server. | |
| __event void | OnListen (void *Sender) |
| The event fires when the server is ready to accept incoming connections (is in listening state). | |
Public Member Functions inherited from CwclCustomConnection | |
| CwclCustomConnection () | |
| Creates a new connection. | |
| virtual | ~CwclCustomConnection () |
| Frees the connection. | |
| wclMessageProcessingMethod | GetMessageProcessing () const |
| Gets the message processing method used by the connection. | |
| __declspec (property(get=GetMessageProcessing)) wclMessageProcessingMethod MessageProcessing | |
| Gets the message processing method used by the connection. | |
| CwclMessageReceiver * | GetReceiver () 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 | |
| virtual void | UnhookDeletedClientEvents (CwclServerClientConnection *const Client) override |
| Unhooks events from the client that should be deleted. | |
| virtual void | SetClientEvents (CwclServerClientConnection *const Client) override |
| The method sets the client's event handlers. | |
| virtual void | DoData (CwclServerClientDataConnection *const Client, const void *const Data, const unsigned long Size) |
Fires the OnData event. | |
Protected Member Functions inherited from CwclServerConnection | |
| void | InternalClose (const int Reason) |
| Closes the server. | |
| int | CreateNewClientConnection (const void *const Params, const unsigned long ParamsSize) |
| Sends a notification to the main thread to create and init new client connection. | |
| virtual void | MessageReceived (const CwclMessage *const Message) override |
| The message receiver calls this method when a new notification message has been received. | |
| virtual void | DoClosed (const int Reason) |
Fires the OnClosed event. | |
| virtual void | DoConnect (CwclServerClientConnection *const Client, const int Error) |
Fires the OnConnect event. | |
| virtual void | DoDisconnect (CwclServerClientConnection *const Client, const int Reason) |
Fires the OnDisconnect event. | |
| virtual void | DoListen () |
Fires the OnListen event. | |
| virtual int | HalListen (CwclEvent *const Event)=0 |
| Implements a hardware-dependent method for listening the client connections. | |
| virtual int | HalClose ()=0 |
| Implements a hardware-dependent method to stop listening. | |
| virtual CwclServerClientConnection * | HalCreateClient ()=0 |
| The method creates a hardware and transport-dependent client connection. | |
| virtual int | HalPrepare ()=0 |
| Implements a hardware-dependent code that prepares for listening. | |
Protected Member Functions inherited from CwclCustomConnection | |
| CwclCriticalSection * | GetCS () |
| Gets the connection critical section. | |
| __declspec (property(get=GetCS)) CwclCriticalSection *CS | |
| Gets the connection critical section. | |
The base class for the server connection that requires data exchange with a remote device.