-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
28 lines (22 loc) · 730 Bytes
/
main.cpp
File metadata and controls
28 lines (22 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <boost/asio.hpp>
#include "receiver.h"
#include "broadcaster.h"
using namespace std;
int main() {
try {
boost::asio::io_service io;
boost::asio::ip::address listen_addr = boost::asio::ip::address::from_string("0.0.0.0");
boost::asio::ip::address multicast_addr = boost::asio::ip::address::from_string("239.255.255.250");
int port = 1900;
receiver rev(io, listen_addr, multicast_addr, port);
broadcaster bcaster(io, multicast_addr, port);
for(int n = 0; n < 2; n++) {
bcaster.send_ssdp_discover();
}
io.run();
} catch (std::exception e) {
std::cerr << e.what() << std::endl;
}
return 0;
}