create a blocking + cancellable Socket::readBytes method

This commit is contained in:
Benjamin Sergeant
2019-03-02 11:01:51 -08:00
parent 0f4e9af172
commit 86cc76388e
5 changed files with 73 additions and 26 deletions

View File

@ -58,7 +58,12 @@ namespace ix
const CancellationRequest& isCancellationRequested);
bool writeBytes(const std::string& str,
const CancellationRequest& isCancellationRequested);
std::pair<bool, std::string> readLine(const CancellationRequest& isCancellationRequested);
std::pair<bool, std::string> readLine(
const CancellationRequest& isCancellationRequested);
std::pair<bool, std::string> readBytes(
size_t length,
const CancellationRequest& isCancellationRequested);
static int getErrno();
static bool init(); // Required on Windows to initialize WinSocket