start SSL

This commit is contained in:
John
2022-02-07 22:34:43 +01:00
parent 0135dc9100
commit e3dfe32350
11 changed files with 339 additions and 36 deletions
+9 -16
View File
@@ -45,7 +45,6 @@ using std::string;
* Class for low level TCP socket operations (open, close, send, receive).
*/
class TCPSocket {
friend class TCPClient;
friend class TCPServer;
private:
@@ -62,6 +61,15 @@ class TCPSocket {
*/
~TCPSocket() { close(m_sfd); }
/**
* initiate a tcp socket connection to a listening server.
* @param server the server name or ip address to connect.
* @param port the tcp port.
* @param timeout the connect, send, and receive timeout in seconds, or 0.
* @return pointer to an opened tcp socket.
*/
static TCPSocket* connect(const string& server, const uint16_t& port, int timeout = 0);
/**
* Write bytes to opened file descriptor.
* @param buffer data to send.
@@ -125,21 +133,6 @@ class TCPSocket {
string m_ip;
};
/**
* class to initiate a TCP socket connection to a listening server.
*/
class TCPClient {
public:
/**
* initiate a tcp socket connection to a listening server.
* @param server the server name or ip address to connect.
* @param port the tcp port.
* @param timeout the connect, send, and receive timeout in seconds, or 0.
* @return pointer to an opened tcp socket.
*/
TCPSocket* connect(const string& server, const uint16_t& port, int timeout = 0);
};
/**
* class for a TCP based network server.
*/