This commit is contained in:
parent
da9f2f2d51
commit
a63d9d1e65
2 changed files with 122 additions and 0 deletions
22
lib/socket/openssl_socket.hpp
Normal file
22
lib/socket/openssl_socket.hpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
#pragma once
|
||||
|
||||
#include "./socket.hpp"
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/err.h>
|
||||
|
||||
namespace anthracite::socket {
|
||||
class openssl_socket : public anthracite_socket {
|
||||
private:
|
||||
static SSL_CTX* _context;
|
||||
SSL* _ssl;
|
||||
|
||||
public:
|
||||
openssl_socket(int port, int max_queue = MAX_QUEUE_LENGTH);
|
||||
~openssl_socket();
|
||||
|
||||
void wait_for_conn() override;
|
||||
void close_conn() override;
|
||||
void send_message(std::string& msg) override;
|
||||
std::string recv_message(int buffer_size) override;
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue