Skip to content

Commit

Permalink
Fixed co_awaits for CHost::from_host_name_and_port(), since it's no l…
Browse files Browse the repository at this point in the history
…onger a coroutine
  • Loading branch information
Andrettin committed Mar 3, 2024
1 parent f2d297a commit 24d73ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/network/master.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ QCoro::Task<int> CMetaClient::Init()
}

// Server socket
CHost metaServerHost = co_await CHost::from_host_name_and_port(metaHost.c_str(), metaPort);
CHost metaServerHost = CHost::from_host_name_and_port(metaHost.c_str(), metaPort);

// Client socket
CHost metaClientHost = co_await CHost::from_host_name_and_port(CNetworkParameter::Instance.localHost.c_str(), CNetworkParameter::Instance.localPort);
CHost metaClientHost = CHost::from_host_name_and_port(CNetworkParameter::Instance.localHost.c_str(), CNetworkParameter::Instance.localPort);

if (metaSocket.Open(metaClientHost) == false) {
fprintf(stderr, "METACLIENT: No free port %d available, aborting\n", metaServerHost.get_port());
Expand Down
2 changes: 1 addition & 1 deletion src/network/network_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ QCoro::Task<bool> network_manager::setup_server_address(const std::string server
auto host = std::make_unique<CHost>();

try {
co_await CHost::from_host_name_and_port(*host, server_address.c_str(), port);
CHost::from_host_name_and_port(*host, server_address.c_str(), port);

if (host->isValid() == false) {
//return false if an error occurred
Expand Down

0 comments on commit 24d73ed

Please sign in to comment.