Fawkes API  Fawkes Development Version
ExamplePluginClientNetworkReceiver Class Reference

Example Plugin network ping tool Small class that waits for a reply of the example plugin after a short network message was sent. More...

Inheritance diagram for ExamplePluginClientNetworkReceiver:

Public Member Functions

 ExamplePluginClientNetworkReceiver ()
 Constructor. More...
 
virtual void deregistered (unsigned int id) throw ()
 The handler got deregistered. More...
 
virtual void inbound_received (FawkesNetworkMessage *m, unsigned int id) throw ()
 Inbound mesage received. More...
 
virtual void connection_died (unsigned int id) throw ()
 Client connection died. More...
 
virtual void connection_established (unsigned int id) throw ()
 Client has established a connection. More...
 
- Public Member Functions inherited from fawkes::FawkesNetworkClientHandler
virtual ~FawkesNetworkClientHandler ()
 Empty virtual destructor. More...
 

Public Attributes

bool quit
 Set to true if answer has been received or handler was deregistered. More...
 

Detailed Description

Example Plugin network ping tool Small class that waits for a reply of the example plugin after a short network message was sent.

Definition at line 37 of file example_plugin_netping.cpp.

Constructor & Destructor Documentation

◆ ExamplePluginClientNetworkReceiver()

ExamplePluginClientNetworkReceiver::ExamplePluginClientNetworkReceiver ( )
inline

Constructor.

Definition at line 41 of file example_plugin_netping.cpp.

Member Function Documentation

◆ connection_died()

virtual void ExamplePluginClientNetworkReceiver::connection_died ( unsigned int  id)
throw (
)
inlinevirtual

Client connection died.

This method is used to inform handlers that the connection has died for any reason. No more data can be send and no more messages should be enqueued because it is unclear when they would be sent.

Parameters
idthe id of the calling client

Implements fawkes::FawkesNetworkClientHandler.

Definition at line 71 of file example_plugin_netping.cpp.

◆ connection_established()

virtual void ExamplePluginClientNetworkReceiver::connection_established ( unsigned int  id)
throw (
)
inlinevirtual

Client has established a connection.

Whenever the client establishes a connection this is signaled to handlers with this method. You can register to a client at any time, you may even enqueue messages to a client while the connection is dead. If the client at some point gets connected again, the messages will then be send out in one go. You should use this in your application though to only send data if the connection is alive and you should let the user know about the connection status.

Parameters
idthe id of the calling client

Implements fawkes::FawkesNetworkClientHandler.

Definition at line 78 of file example_plugin_netping.cpp.

◆ deregistered()

virtual void ExamplePluginClientNetworkReceiver::deregistered ( unsigned int  id)
throw (
)
inlinevirtual

The handler got deregistered.

Parameters
idthe id of the calling client

Implements fawkes::FawkesNetworkClientHandler.

Definition at line 49 of file example_plugin_netping.cpp.

◆ inbound_received()

virtual void ExamplePluginClientNetworkReceiver::inbound_received ( FawkesNetworkMessage m,
unsigned int  id 
)
throw (
)
inlinevirtual

Inbound mesage received.

Parameters
mmessage
idthe id of the calling thread

Implements fawkes::FawkesNetworkClientHandler.

Definition at line 59 of file example_plugin_netping.cpp.

Member Data Documentation

◆ quit

bool ExamplePluginClientNetworkReceiver::quit

Set to true if answer has been received or handler was deregistered.

False at object creation.

Definition at line 87 of file example_plugin_netping.cpp.


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