|Empty constructor, init bundle and vars, Properties and Methods. |
|Empty destructor, may (synch) stop bundle and internal threads when still running. |
|Start the discovery procedure of remote WOSH hosts. Announcement may be synchronous or asynchronous, but the discovery procedure is intrinsically asynchronous. |
|real implementation based on wosh::BundleGenericWorker (worker thread) |
Implements Host Discovery service on top of UDP.
Discovery service enables the (reciprocal) discovery of WOSH hosts sending and receiving information as UDP datagrams. The service interacts with wosh::NetworkManager which holds the updated list of all known WOSH hosts of the wosh-network.
The DiscoveryUdpBundle service is (build and) installed on all WOSH Applications and represents the most common Host-Discovery service.
A sample configuration is available: 001_DiscoveryUdp.conf
The service runs an UDP server on local-host (you may bind it to ANY interface on most platforms) listening for incomin packets (sent by remote hosts); periodically it broadcast discovery-messages to one or more hosts (address/port), frequency is configurable.
Most important Properties are:
BindAddressPort- set to local address:port (default '0.0.0.0:8787' binds to any interface)
BroadcastAddressPortList- set to remote address:port, separated by ';' (such as '192.168.0.255:8787;192.168.1.255:8787' )
NotifyFrequency- set the interval of discovery, in seconds (default 60 = 1 minute)
These fields and the important role of Discovery service is deeply related to WOSH Networking.
Suppose you have a LAN with two or more hosts, their IP looks like X.Y.Z.<NODE-id> (192.168.0.1, 192.168.0.56 and so on), then settings are the same for all hosts: Bind to '0.0.0.0:8787' and Broadcast to 'X.Y.Z.255:8787'. A more complex case is the following: one of these hosts is a sort of gateway and is connected to another LAN (as the wireless-network), let's say A.B.C (192.168.1.x), then just add 'A.B.C.255:8787' to the Broadcast list (of all hosts), so it looks like '192.168.0.255:8787;192.168.1.255:8787'.
Theorically almost all fields of WoshHost may be sent, actually only few of them are required by the WOSH networking-system. Most important fields included in package are:
Kernel-Name- name of wosh::the WoshKernel
Bind-Address- of the remote DiscoveryUdp service
Notify-Frequenct- of the remote DiscoveryUdp service, used to estimate timeout
Supported-Protocols- the communication-protocols supported by the host (such as TCP:://192.168.0.1:9797)
Neighbours- neighbour hosts, used by NetworkManager to keep smart routing table
A typical log-output emphatizing the system-results of an incoming Discovery packet is:
I^18:39:26 NetworkManager:updateWoshHost(wosh28, 1,0, -2) Updated Host
DiscoveryUdp is a wrapper (bundle-adapter), real implementation is DiscoveryUdpImpl.
Start the discovery procedure of remote WOSH hosts. Announcement may be synchronous or asynchronous, but the discovery procedure is intrinsically asynchronous.