Fawkes API  Fawkes Development Version
fawkes::FawkesNetworkClientHandler Class Referenceabstract

Message handler for FawkesNetworkClient. More...

#include <>>

Inheritance diagram for fawkes::FawkesNetworkClientHandler:

Public Member Functions

virtual ~FawkesNetworkClientHandler ()
 Empty virtual destructor. More...
 
virtual void deregistered (unsigned int id)=0 throw ()
 This handler has been deregistered. More...
 
virtual void inbound_received (FawkesNetworkMessage *m, unsigned int id)=0 throw ()
 Called for incoming messages. More...
 
virtual void connection_died (unsigned int id)=0 throw ()
 Client connection died. More...
 
virtual void connection_established (unsigned int id)=0 throw ()
 Client has established a connection. More...
 

Detailed Description

Message handler for FawkesNetworkClient.

This interface is used by the FawkesNetworkClient to handle incoming messages.

Author
Tim Niemueller

Definition at line 31 of file client_handler.h.

Constructor & Destructor Documentation

◆ ~FawkesNetworkClientHandler()

fawkes::FawkesNetworkClientHandler::~FawkesNetworkClientHandler ( )
virtual

Empty virtual destructor.

Definition at line 69 of file client_handler.cpp.

Member Function Documentation

◆ connection_died()

void fawkes::FawkesNetworkClientHandler::connection_died ( unsigned int  id)
throw (
)
pure virtual

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

Implemented in SkillShellThread, SkillShellThread, fawkes::NetworkConfiguration, fawkes::RemoteBlackBoard, ExamplePluginClientNetworkReceiver, and fawkes::ConnectionDispatcher.

◆ connection_established()

void fawkes::FawkesNetworkClientHandler::connection_established ( unsigned int  id)
throw (
)
pure virtual

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

Implemented in SkillShellThread, SkillShellThread, fawkes::NetworkConfiguration, fawkes::RemoteBlackBoard, ExamplePluginClientNetworkReceiver, and fawkes::ConnectionDispatcher.

◆ deregistered()

void fawkes::FawkesNetworkClientHandler::deregistered ( unsigned int  id)
throw (
)
pure virtual

This handler has been deregistered.

This is called when this handler is deregistered from the FawkesNetworkClient. Sometimes you may not want to allow this and post a big fat warning into the log.

Parameters
idthe id of the calling client

Implemented in SkillShellThread, SkillShellThread, fawkes::NetworkConfiguration, fawkes::RemoteBlackBoard, fawkes::ConnectionDispatcher, and ExamplePluginClientNetworkReceiver.

◆ inbound_received()

void fawkes::FawkesNetworkClientHandler::inbound_received ( FawkesNetworkMessage m,
unsigned int  id 
)
throw (
)
pure virtual

Called for incoming messages.

This is called when an incoming message has been received. If this method was called one or more times then the a previously carried out wait(cid) call will continue.

Parameters
mMessage to handle
idthe id of the calling client

Implemented in SkillShellThread, SkillShellThread, fawkes::NetworkConfiguration, fawkes::RemoteBlackBoard, ExamplePluginClientNetworkReceiver, and fawkes::ConnectionDispatcher.


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