Fawkes API
Fawkes Development Version
|
Thread aspect for network communication. More...
#include <>>
Public Member Functions | |
NetworkAspect () | |
Constructor. More... | |
virtual | ~NetworkAspect () |
Virtual empty Destructor. More... | |
void | init_NetworkAspect (NetworkNameResolver *resolver, ServicePublisher *service_publisher, ServiceBrowser *service_browser) |
Init network aspect. More... | |
![]() | |
const std::list< const char * > & | get_aspects () const |
Get list of aspect names attached to a aspected thread. More... | |
Protected Attributes | |
NetworkNameResolver * | nnresolver |
Network name resolver to lookup IP addresses of hostnames and vice versa. More... | |
ServicePublisher * | service_publisher |
Service publisher to publish services on the network. More... | |
ServiceBrowser * | service_browser |
Service browser to browse services on the network. More... | |
Additional Inherited Members | |
![]() | |
void | add_aspect (const char *name) |
Add an aspect to a thread. More... | |
Thread aspect for network communication.
Give this aspect to your thread if you want to implement custom network communication. With this aspect you get access to the central network name resolver and you may publish service on the network and browse for existing services (for example using mDNS-SD via Avahi).
It is guaranteed that if used properly from within plugins that init_NetworkAspect() is called before the thread is started.
fawkes::NetworkAspect::NetworkAspect | ( | ) |
|
virtual |
Virtual empty Destructor.
Definition at line 71 of file network.cpp.
void fawkes::NetworkAspect::init_NetworkAspect | ( | NetworkNameResolver * | resolver, |
ServicePublisher * | service_publisher, | ||
ServiceBrowser * | service_browser | ||
) |
Init network aspect.
It is guaranteed that this is called for a thread having the netwok aspect before Thread::start() is called (when running regularly inside Fawkes).
resolver | network name resolver |
service_publisher | service publisher |
service_browser | service browser |
Definition at line 85 of file network.cpp.
References nnresolver, service_browser, and service_publisher.
Referenced by fawkes::NetworkAspectIniFin::init().
|
protected |
Network name resolver to lookup IP addresses of hostnames and vice versa.
The nnresolver will remain valid for the whole lifetime of the thread.
Definition at line 48 of file network.h.
Referenced by FountainThread::init(), XmlRpcThread::init(), PlayerClientThread::init(), WebviewThread::init(), and init_NetworkAspect().
|
protected |
Service browser to browse services on the network.
The service_browser will remain valid for the whole lifetime of the thread.
Definition at line 50 of file network.h.
Referenced by WebviewThread::finalize(), WebviewThread::init(), and init_NetworkAspect().
|
protected |
Service publisher to publish services on the network.
The service_publisher will remain valid for the whole lifetime of the thread.
Definition at line 49 of file network.h.
Referenced by FountainThread::finalize(), XmlRpcThread::finalize(), WebviewThread::finalize(), GossipThread::init(), FountainThread::init(), XmlRpcThread::init(), WebviewThread::init(), and init_NetworkAspect().