Fawkes API  Fawkes Development Version
fawkes::NetworkAspect Class Reference

#include <>>

Inheritance diagram for fawkes::NetworkAspect:

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...
 
- Public Member Functions inherited from fawkes::Aspect
const std::list< const char * > & get_aspects () const
 Get list of aspect names attached to a aspected thread. More...
 

Protected Attributes

NetworkNameResolvernnresolver
 
ServicePublisherservice_publisher
 
ServiceBrowserservice_browser
 

Additional Inherited Members

- Protected Member Functions inherited from fawkes::Aspect
void add_aspect (const char *name)
 Add an aspect to a thread. More...
 

Detailed Description

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.

Author
Tim Niemueller

Definition at line 40 of file network.h.

Constructor & Destructor Documentation

◆ NetworkAspect()

fawkes::NetworkAspect::NetworkAspect ( )

Constructor.

Definition at line 67 of file network.cpp.

◆ ~NetworkAspect()

fawkes::NetworkAspect::~NetworkAspect ( )
virtual

Virtual empty Destructor.

Definition at line 73 of file network.cpp.

References nnresolver, and service_publisher.

Member Function Documentation

◆ init_NetworkAspect()

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).

Parameters
resolvernetwork name resolver
service_publisherservice publisher
service_browserservice browser

Definition at line 86 of file network.cpp.

Member Data Documentation

◆ nnresolver

NetworkNameResolver fawkes::NetworkAspect::nnresolver
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 57 of file network.h.

Referenced by FountainThread::init(), WebviewThread::init(), XmlRpcThread::init(), and ~NetworkAspect().

◆ service_browser

NetworkNameResolver fawkes::NetworkAspect::service_browser
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 59 of file network.h.

Referenced by WebviewThread::finalize(), and WebviewThread::init().

◆ service_publisher

NetworkNameResolver fawkes::NetworkAspect::service_publisher
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 58 of file network.h.

Referenced by FountainThread::finalize(), WebviewThread::finalize(), XmlRpcThread::finalize(), FountainThread::init(), GossipThread::init(), WebviewThread::init(), XmlRpcThread::init(), and ~NetworkAspect().


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