mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-15 22:54:00 +00:00
udp/client: Make use of designated initializers in TestCommunication()
Same behavior, but makes the callback list nicer to look at.
This commit is contained in:
parent
36cfb234d5
commit
30b1e71066
1 changed files with 5 additions and 2 deletions
|
@ -337,8 +337,11 @@ void TestCommunication(const std::string& host, u16 port, std::size_t pad_index,
|
|||
const std::function<void()>& failure_callback) {
|
||||
std::thread([=] {
|
||||
Common::Event success_event;
|
||||
SocketCallback callback{[](Response::Version version) {}, [](Response::PortInfo info) {},
|
||||
[&](Response::PadData data) { success_event.Set(); }};
|
||||
SocketCallback callback{
|
||||
.version = [](Response::Version) {},
|
||||
.port_info = [](Response::PortInfo) {},
|
||||
.pad_data = [&](Response::PadData) { success_event.Set(); },
|
||||
};
|
||||
Socket socket{host, port, pad_index, client_id, std::move(callback)};
|
||||
std::thread worker_thread{SocketLoop, &socket};
|
||||
const bool result = success_event.WaitFor(std::chrono::seconds(8));
|
||||
|
|
Loading…
Reference in a new issue