broken ssl
Some checks failed
Docker Build & Publish / build (push) Has been cancelled

This commit is contained in:
Nicholas Orlowsky 2025-02-17 18:46:33 -05:00
parent 10ca7f9f51
commit da9f2f2d51
Signed by: nickorlow
GPG key ID: 838827D8C4611687
4 changed files with 66 additions and 30 deletions

View file

@ -1,3 +1,5 @@
#pragma once
#include <arpa/inet.h>
#include <malloc.h>
#include <netinet/in.h>
@ -10,23 +12,25 @@ namespace anthracite::socket {
class anthracite_socket {
static const int MAX_QUEUE_LENGTH = 100;
private:
protected:
int server_socket;
int client_socket {};
std::string client_ip;
struct sockaddr_in client_addr {};
socklen_t client_addr_len {};
static const struct timeval timeout_tv;
static const int MAX_QUEUE_LENGTH = 100;
public:
anthracite_socket(int port, int max_queue = MAX_QUEUE_LENGTH);
void wait_for_conn();
const std::string& get_client_ip();
void close_conn();
void send_message(std::string& msg);
std::string recv_message(int buffer_size);
virtual const std::string& get_client_ip() final;
virtual void wait_for_conn();
virtual void close_conn();
virtual void send_message(std::string& msg);
virtual std::string recv_message(int buffer_size);
};
};