diff options
Diffstat (limited to 'src/input_common/udp/client.cpp')
| -rw-r--r-- | src/input_common/udp/client.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/input_common/udp/client.cpp b/src/input_common/udp/client.cpp index bb109562c..e3dd8a4be 100644 --- a/src/input_common/udp/client.cpp +++ b/src/input_common/udp/client.cpp | |||
| @@ -333,15 +333,15 @@ const std::array<Common::SPSCQueue<UDPPadStatus>, 4>& Client::GetPadQueue() cons | |||
| 333 | } | 333 | } |
| 334 | 334 | ||
| 335 | void TestCommunication(const std::string& host, u16 port, std::size_t pad_index, u32 client_id, | 335 | void TestCommunication(const std::string& host, u16 port, std::size_t pad_index, u32 client_id, |
| 336 | std::function<void()> success_callback, | 336 | const std::function<void()>& success_callback, |
| 337 | std::function<void()> failure_callback) { | 337 | const std::function<void()>& failure_callback) { |
| 338 | std::thread([=] { | 338 | std::thread([=] { |
| 339 | Common::Event success_event; | 339 | Common::Event success_event; |
| 340 | SocketCallback callback{[](Response::Version version) {}, [](Response::PortInfo info) {}, | 340 | SocketCallback callback{[](Response::Version version) {}, [](Response::PortInfo info) {}, |
| 341 | [&](Response::PadData data) { success_event.Set(); }}; | 341 | [&](Response::PadData data) { success_event.Set(); }}; |
| 342 | Socket socket{host, port, pad_index, client_id, std::move(callback)}; | 342 | Socket socket{host, port, pad_index, client_id, std::move(callback)}; |
| 343 | std::thread worker_thread{SocketLoop, &socket}; | 343 | std::thread worker_thread{SocketLoop, &socket}; |
| 344 | bool result = success_event.WaitFor(std::chrono::seconds(8)); | 344 | const bool result = success_event.WaitFor(std::chrono::seconds(8)); |
| 345 | socket.Stop(); | 345 | socket.Stop(); |
| 346 | worker_thread.join(); | 346 | worker_thread.join(); |
| 347 | if (result) { | 347 | if (result) { |