diff options
Diffstat (limited to 'cast/common/channel/cast_socket.cc')
-rw-r--r-- | cast/common/channel/cast_socket.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cast/common/channel/cast_socket.cc b/cast/common/channel/cast_socket.cc index 8ad61542..ce35e54e 100644 --- a/cast/common/channel/cast_socket.cc +++ b/cast/common/channel/cast_socket.cc @@ -4,6 +4,8 @@ #include "cast/common/channel/cast_socket.h" +#include <atomic> + #include "cast/common/channel/message_framer.h" #include "platform/api/logging.h" @@ -14,6 +16,11 @@ using message_serialization::DeserializeResult; using openscreen::ErrorOr; using openscreen::platform::TlsConnection; +uint32_t GetNextSocketId() { + static std::atomic<uint32_t> id(1); + return id++; +} + CastSocket::CastSocket(std::unique_ptr<TlsConnection> connection, Client* client, uint32_t socket_id) |