Fixing style.

This commit is contained in:
Ben Vanik 2015-11-05 16:39:27 -08:00
parent a5eec3d2c5
commit 65c5279611
1 changed files with 22 additions and 19 deletions

View File

@ -259,26 +259,29 @@ class Win32SocketServer : public SocketServer {
return false; return false;
} }
accept_thread_ = xe::threading::Thread::Create({}, [this, port]() { accept_thread_ = xe::threading::Thread::Create(
xe::threading::set_name(std::string("xe::SocketServer localhost:") + {},
std::to_string(port)); [this, port]() {
while (socket_ != INVALID_SOCKET) { xe::threading::set_name(std::string("xe::SocketServer localhost:") +
sockaddr_in6 client_addr; std::to_string(port));
int client_count = sizeof(client_addr); while (socket_ != INVALID_SOCKET) {
SOCKET client_socket = accept( sockaddr_in6 client_addr;
socket_, reinterpret_cast<sockaddr*>(&client_addr), &client_count); int client_count = sizeof(client_addr);
if (client_socket == INVALID_SOCKET) { SOCKET client_socket =
continue; accept(socket_, reinterpret_cast<sockaddr*>(&client_addr),
} &client_count);
if (client_socket == INVALID_SOCKET) {
continue;
}
auto client = std::make_unique<Win32Socket>(); auto client = std::make_unique<Win32Socket>();
if (!client->Accept(client_socket)) { if (!client->Accept(client_socket)) {
XELOGE("Unable to accept socket; ignoring"); XELOGE("Unable to accept socket; ignoring");
continue; continue;
} }
accept_callback_(std::move(client)); accept_callback_(std::move(client));
} }
}); });
return true; return true;
} }