Changed code to support Windows libraries and functions as well

This commit is contained in:
2024-02-29 16:38:36 -05:00
parent ddbbc322a6
commit 4b3d5387a1
6 changed files with 55 additions and 30 deletions

View File

@@ -1,4 +1,9 @@
#include <sys/socket.h>
#ifdef linux
#include <sys/socket.h>
#endif
#ifdef _WIN32
#include <winsock2.h>
#endif
#include <fcntl.h>
#include "includes/sock.hpp"
#include "includes/server.hpp"
@@ -15,7 +20,6 @@ Server::~Server() {
/* Sends given data through the peer socket - This method is overriden from the
base method, because a different socket must be used. In the server's case, the
'peer' socket i.e. the socket returned after calling 'accept', must be used. */
void Server::sendAll(std::string to_send) {
Sock::sendAll(to_send);
}