Skip to content
Snippets Groups Projects
Verified Commit b6613c81 authored by Benny Baumann's avatar Benny Baumann
Browse files

fix: Mark client counter as atomic for thread-safety

parent ab7f0de8
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#pragma once #pragma once
#include <atomic>
#include <memory> #include <memory>
#include "net/async_server.hpp" #include "net/async_server.hpp"
...@@ -22,7 +23,7 @@ public: ...@@ -22,7 +23,7 @@ public:
private: private:
async_server_socket::self_ptr_type ss; async_server_socket::self_ptr_type ss;
incoming_client_listener_type client_listener; incoming_client_listener_type client_listener;
int number_of_connected_clients; std::atomic_uint32_t number_of_connected_clients;
public: public:
tcp_server_socket(uint16_t port, incoming_client_listener_type client_listener_); tcp_server_socket(uint16_t port, incoming_client_listener_type client_listener_);
int get_number_of_connected_clients() const; int get_number_of_connected_clients() const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment