Files
Np_Term/include/session/session.h
2025-05-31 03:19:58 +09:00

31 lines
627 B
C++

#pragma once
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/ssl.h>
#include "socket/iocp.h"
#include "utils/thread_pool.h"
namespace Network {
enum class SessionType { LISTEN, CONNECT };
class Session {
public:
Session(gsl::not_null<Network::IOCP*> iocp, utils::ThreadPool* tp,
SessionType type, SessionProtocol proto, Network::Address addr);
~Session();
private:
gsl::not_null<Network::IOCP*> iocp_;
utils::ThreadPool* tp_ = nullptr;
SessionProtocol proto_;
Network::Socket* sock_ = nullptr;
SSL_CTX* ssl_ctx_ = nullptr;
SSL* ssl_ = nullptr;
};
} // namespace Network