Added fr::Socket::has_data to check if recv buffer is empty

If using a SocketSelector, you should keep accepting data from the socket until has_data returns false, indicating that you've read everything.
This commit is contained in:
Fred Nicolson
2016-12-27 21:58:39 +00:00
parent 8638b70fb8
commit 2a5d960e56
6 changed files with 39 additions and 1 deletions
+5
View File
@@ -168,6 +168,11 @@ namespace fr
is_connected = true;
ssl_socket_descriptor = std::move(context);
}
bool SSLSocket::has_data() const
{
return !unprocessed_buffer.empty();
}
}
#endif