From f27bda8e8d7fcfe82ad20d345c63d327ff047b11 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 8 Jun 2021 18:25:36 +0800 Subject: ... --- computer-network-experiment/Common.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'computer-network-experiment/Common.h') diff --git a/computer-network-experiment/Common.h b/computer-network-experiment/Common.h index a4472c7..1e6c277 100644 --- a/computer-network-experiment/Common.h +++ b/computer-network-experiment/Common.h @@ -48,5 +48,7 @@ int CloseSocket(int socket); void BeforeExit(); -void SafeSend(int socket, std::string_view buffer); -std::string SafeReadUntil(int socket, char c, std::string &rest); +// Return false for error. +bool SafeSend(int socket, std::string_view buffer); +// Return false for error. +bool SafeReadUntil(int socket, char c, std::string &data, std::string &rest); -- cgit v1.2.3