Removed ip_ver parameter
I removed this because I realized I could just check the IP version inside the constructor. The Sock constructor now checks the address passed to it. Like before, if the address is neither v4 nor v6, an exception is thrown. Since the Server and Client constructors call the Sock constructor, no change was required in these files, except passing the right number of parameters.
This commit is contained in:
@@ -15,7 +15,7 @@ public:
|
||||
~Client();
|
||||
|
||||
/* Normal constructor that calls the parent constructor to set the given values */
|
||||
Client(int ip_ver, char protocol, const char* address, int port) : Sock(ip_ver, protocol, address, port) {}
|
||||
Client(char protocol, const char* address, int port) : Sock(protocol, address, port) {}
|
||||
|
||||
void create_socket() override;
|
||||
|
||||
|
@@ -15,7 +15,7 @@ public:
|
||||
/* Constructors */
|
||||
Server() {}
|
||||
|
||||
Server(int ip_ver, char protocol, const char* address, int port) : Sock(ip_ver, protocol, address, port) {}
|
||||
Server(char protocol, const char* address, int port) : Sock(protocol, address, port) {}
|
||||
|
||||
/* Destructor */
|
||||
~Server();
|
||||
|
@@ -38,7 +38,7 @@ public:
|
||||
virtual ~Sock();
|
||||
|
||||
/* Regular constructor - defined in sock.cpp */
|
||||
Sock(int ip_ver, char protocol, const char* address, int port);
|
||||
Sock(char protocol, const char* address, int port);
|
||||
|
||||
/* Method to send data in 'to_send' through the 'other_socket' socket */
|
||||
void sendAll(std::string to_send);
|
||||
|
Reference in New Issue
Block a user