Skip to content

Sobottasgithub/TUD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TUD

The Tablo Udp Discovery module can be used to easely implement UDP discovery into your project.

To use TUD in your project you need to include it first. After including TUD to your project you can implement the server like this:

#include "server_discovery.h"
auto serverDiscovery = std::make_shared<tud::ServerDiscovery>(interface, 4000, 4001, "yourNewIdenifier");
std::thread serverDiscoveryThread([serverDiscovery]() {
  serverDiscovery->discoveryCycle();
});

And the client like this:

#include "client_discovery.h"
auto clientDiscovery = std::make_shared<tud::ClientDiscovery>(interface, 4000, 4001, "yourNewIdenifier");
std::thread clientDiscoveryThread([clientDiscovery]() {
  clientDiscovery->discoveryCycle();
});

Both constructors want:

  1. your internet interface (string)
  2. your in port (int)
  3. your out port (int)
  4. your identifier (optional string)

Then you can use it with these functions:

std::vector<std::string> getDiscoveredAddresses();
void removeDiscoveredAddress(std::string address);

std::string getLocalIpAddress(std::string interface);
std::string getBroadcastIpAddress();
bool isValidIpV4(std::string &ipString);

About

Tablo Udp Discovery

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors