Added a virtual destructor to the Sock class, which would allow Server and Client to override it

master
Aadhavan Srinivasan 10 months ago
parent c2c095dfa7
commit 8e3488b904

@ -34,6 +34,9 @@ public:
/* Default constructor */
Sock() {}
/* Virtual destructor */
virtual ~Sock();
/* Regular constructor - defined in sock.cpp */
Sock(int ip_ver, char protocol, const char* address, int port);

@ -13,6 +13,10 @@ void Sock::create_socket() {
addrlen = sizeof(*dest);
}
/* Virtual destructor, allows 'Server' and 'Client' to override this destructor */
Sock::~Sock() {}
/* Constructor - This function initializes the object attributes with the given
parameters. It throws an exception if an IPv4 address was given, but the type
given is IPv6 (or the other way around). */

Loading…
Cancel
Save