blob: f0bec0b63557ca048ce69398654c11a0bc38effd (
plain) (
tree)
|
|
#pragma once
#include <boost/asio.hpp>
#include <mutex>
#include <memory>
#include <unordered_set>
namespace math::server {
class Session;
using SessionPtr = std::shared_ptr<Session>;
class SessionManager {
public:
SessionManager() = default;
SessionPtr make_session(boost::asio::io_context&);
void start(const SessionPtr&);
void stop(const SessionPtr&);
void stop_all();
private:
std::mutex m_mtx;
std::unordered_set<SessionPtr> m_sessions;
};
}
|