Made the 'recvAll' function return a char pointer instead of a std::string, this is better for portability. Also created a non-blocking version of the function.

This commit is contained in:
2024-02-27 23:59:53 -05:00
parent 6d1565a020
commit c6bbe82d25
2 changed files with 38 additions and 5 deletions

View File

@@ -30,10 +30,13 @@ public:
FOR UDP - Send data to the client, from which data was received.
FOR UDP, this function MUST be called after recvAll() */
void sendAll(std::string to_send);
/* Receive data from peer socket */
std::string recvAll();
char* recvAll();
/* Non-blocking receive */
char* recvAllNB();
/* Return the address of the peer */
std::string get_peer_addr();