Feature/connection state (#25)
* (cmake) add a warning about 32/64 conversion problems. * fix typo * New connection state for server code + fix OpenSSL double init bug * update README
This commit is contained in:
committed by
GitHub
parent
0635313566
commit
eac611ab1e
37
ixwebsocket/IXConnectionState.cpp
Normal file
37
ixwebsocket/IXConnectionState.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* IXConnectionState.cpp
|
||||
* Author: Benjamin Sergeant
|
||||
* Copyright (c) 2019 Machine Zone, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include "IXConnectionState.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace ix
|
||||
{
|
||||
std::atomic<uint64_t> ConnectionState::_globalId(0);
|
||||
|
||||
ConnectionState::ConnectionState()
|
||||
{
|
||||
computeId();
|
||||
}
|
||||
|
||||
void ConnectionState::computeId()
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << _globalId++;
|
||||
_id = ss.str();
|
||||
}
|
||||
|
||||
const std::string& ConnectionState::getId() const
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
|
||||
std::shared_ptr<ConnectionState> ConnectionState::createConnectionState()
|
||||
{
|
||||
return std::make_shared<ConnectionState>();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user