| 1 | #include "signaling/websocket_service.h" |
| 2 | |
| 3 | int main() { |
| 4 | Args args{ |
| 5 | .uid = "test_device", |
| 6 | .ws_key = "", |
| 7 | .ws_host = "localhost", |
| 8 | .ws_room = "", |
| 9 | }; |
| 10 | |
| 11 | net::io_context ioc; |
| 12 | |
| 13 | boost::asio::steady_timer timer(ioc, std::chrono::seconds(5)); |
| 14 | timer.async_wait([&ioc](const boost::system::error_code &ec) { |
| 15 | if (!ec) { |
| 16 | std::cout << "no events in io_context" << std::endl; |
| 17 | ioc.stop(); |
| 18 | } |
| 19 | }); |
| 20 | |
| 21 | auto ws_service = WebsocketService::Create(args, nullptr, ioc); |
| 22 | ws_service->Start(); |
| 23 | |
| 24 | ioc.run(); |
| 25 | return 0; |
| 26 | } |