Add simple reading to TlsConnection
This patch implements a ReceiveMessage method for TlsConnectionPosix,
that simply checks if bytes are pending and then reads them if so,
reporting any errors that occur.
Change-Id: If9c453cd466c235c502ed16deedac3b7538a6a46
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1816287
Reviewed-by: Jordan Bayles <jophba@chromium.org>
Reviewed-by: Yuri Wiitala <miu@chromium.org>
Reviewed-by: Ryan Keane <rwkeane@google.com>
Commit-Queue: Jordan Bayles <jophba@chromium.org>
diff --git a/platform/api/tls_connection.h b/platform/api/tls_connection.h
index 1126265..de7faff 100644
--- a/platform/api/tls_connection.h
+++ b/platform/api/tls_connection.h
@@ -33,11 +33,11 @@
virtual void OnWriteUnblocked(TlsConnection* connection) = 0;
// Called when |connection| experiences an error, such as a read error.
- virtual void OnError(TlsConnection* socket, Error error) = 0;
+ virtual void OnError(TlsConnection* connection, Error error) = 0;
- // Called when a |packet| arrives on |socket|.
- virtual void OnRead(TlsConnection* socket,
- std::vector<uint8_t> message) = 0;
+ // Called when a |block| arrives on |connection|.
+ virtual void OnRead(TlsConnection* connection,
+ std::vector<uint8_t> block) = 0;
protected:
virtual ~Client() = default;