Fawkes API  Fawkes Development Version
fawkes::NetworkAspect Class Reference

Thread aspect for network communication. More...

#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
 Network name resolver to lookup IP addresses of hostnames and vice versa. More...
 
ServicePublisherservice_publisher
 Service publisher to publish services on the network. More...
 
ServiceBrowserservice_browser
 Service browser to browse services on the network. More...
 

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 37 of file network.h.

Constructor & Destructor Documentation

◆ NetworkAspect()

fawkes::NetworkAspect::NetworkAspect ( )

Constructor.

Definition at line 65 of file network.cpp.

References fawkes::Aspect::add_aspect().

◆ ~NetworkAspect()

fawkes::NetworkAspect::~NetworkAspect ( )
virtual

Virtual empty Destructor.

Definition at line 71 of file network.cpp.

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 85 of file network.cpp.

References nnresolver, service_browser, and service_publisher.

Referenced by fawkes::NetworkAspectIniFin::init().

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 48 of file network.h.

Referenced by FountainThread::init(), XmlRpcThread::init(), PlayerClientThread::init(), WebviewThread::init(), and init_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 50 of file network.h.

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

◆ 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 49 of file network.h.

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


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