diff --git a/gsock_helper.cpp b/gsock_helper.cpp index 9dc4859..54e738c 100644 --- a/gsock_helper.cpp +++ b/gsock_helper.cpp @@ -58,6 +58,12 @@ int sock_helper::sendall(const void* ptr, int datasz) return sendall(ptr, datasz, x); } +int sock_helper::sendall(const std::string& data) +{ + int x; + return sendall(data.data(), data.size(), x); +} + int sock_helper::recvall(void* ptr, int length_to_recv) { int x; diff --git a/gsock_helper.h b/gsock_helper.h index 3b07fb7..df429bd 100644 --- a/gsock_helper.h +++ b/gsock_helper.h @@ -15,6 +15,7 @@ class sock_helper public: sock_helper(sock&); + int sendall(const std::string& data); int sendall(const void* ptr, int datasz); int sendall(const void* ptr, int datasz, int& bytes_sent);