event/BufferedSocket: pass std::span to OnSocketInput()
This commit is contained in:
@@ -56,7 +56,7 @@ BufferedSocket::ResumeInput() noexcept
|
||||
return true;
|
||||
}
|
||||
|
||||
const auto result = OnSocketInput(buffer.data(), buffer.size());
|
||||
const auto result = OnSocketInput(buffer);
|
||||
switch (result) {
|
||||
case InputResult::MORE:
|
||||
if (input.IsFull()) {
|
||||
|
@@ -109,11 +109,11 @@ protected:
|
||||
/**
|
||||
* Data has been received on the socket.
|
||||
*
|
||||
* @param data a pointer to the beginning of the buffer; the
|
||||
* @param src the buffer containing the data; the
|
||||
* buffer may be modified by the method while it processes the
|
||||
* data
|
||||
*/
|
||||
virtual InputResult OnSocketInput(void *data, size_t length) noexcept = 0;
|
||||
virtual InputResult OnSocketInput(std::span<std::byte> src) noexcept = 0;
|
||||
|
||||
virtual void OnSocketError(std::exception_ptr ep) noexcept = 0;
|
||||
virtual void OnSocketClosed() noexcept = 0;
|
||||
|
Reference in New Issue
Block a user