gocarlos / mdns_cpp Goto Github PK
View Code? Open in Web Editor NEWsimple mDNS service with C++ interface
License: MIT License
simple mDNS service with C++ interface
License: MIT License
I guess it make sense: there is no timeout for select specified. So program will never shutdown or shutdown if there will be no activity on the network.
Line 440 in 05b181c
Really just a C++ wrapper?
If I want to register many services at the same time, what should i do to use your code?
When I try to build mdns_cpp
on Windows with MSYS2/MINGW it fails with the following output:
$ cmake --build .
[ 10%] Building CXX object CMakeFiles/mdns_cpp.dir/src/logger.cpp.obj
[ 20%] Building CXX object CMakeFiles/mdns_cpp.dir/src/mdns.cpp.obj
C:\msys64\home\david\projects\mdns_cpp-master\src\mdns.cpp: In member function 'int mdns_cpp::mDNS::openServiceSockets(int*, int)':
C:\msys64\home\david\projects\mdns_cpp-master\src\mdns.cpp:38:26: error: 'in4addr_any' was not declared in this scope; did you mean 'in6addr_any'?
38 | sock_addr.sin_addr = in4addr_any;
| ^~~~~~~~~~~
| in6addr_any
mingw32-make[2]: *** [CMakeFiles\mdns_cpp.dir\build.make:91: CMakeFiles/mdns_cpp.dir/src/mdns.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:88: CMakeFiles/mdns_cpp.dir/all] Error 2
mingw32-make: *** [Makefile:135: all] Error 2
The following patch removed the error and the mdns_cpp
build succeeded. And the example programs seem to work as expected.
--- mdns.cpp.original 2022-09-07 14:22:48.000000000 +0800
+++ mdns.cpp 2023-08-10 21:23:03.502663800 +0800
@@ -35,7 +35,7 @@
sockaddr_in sock_addr{};
sock_addr.sin_family = AF_INET;
#ifdef _WIN32
- sock_addr.sin_addr = in4addr_any;
+ sock_addr.sin_addr.s_addr = INADDR_ANY;
#else
sock_addr.sin_addr.s_addr = INADDR_ANY;
#endif
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.