You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
677 B
C++

#ifndef _CLIENT_H
#define _CLIENT_H
#include "includes/sock.hpp"
/* Client class - Inherits from 'Sock' class - Defines a TCP/UDP client. */
class Client : public Sock {
public:
/* Default constructor - Does nothing */
Client() {};
/* Destructor - defined in client.cpp */
~Client();
/* Normal constructor that calls the parent constructor to set the given values */
Client(char protocol, const char* address, int port) : Sock(protocol, address, port) {}
void create_socket() override;
void sendAll(std::string to_send);
char* recvAll();
/* Non-blocking receive */
char* recvAllNB();
/* Return the type of socket */
int get_type() override;
};
#endif