char -> std::byte
This commit is contained in:
parent
5121c2a27b
commit
2b14257c52
@ -321,7 +321,7 @@ void NonBlockingClient::disconnect() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] std::expected<int, int>
|
[[nodiscard]] std::expected<int, int>
|
||||||
NonBlockingClient::send(std::span<const char> data) {
|
NonBlockingClient::send(std::span<const std::byte> data) {
|
||||||
// TODO: Do we need this?
|
// TODO: Do we need this?
|
||||||
auto conRes = get_last_connection_status();
|
auto conRes = get_last_connection_status();
|
||||||
if (!conRes) return std::unexpected{conRes.error()};
|
if (!conRes) return std::unexpected{conRes.error()};
|
||||||
@ -359,7 +359,7 @@ bool NonBlockingClient::data_available() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] std::expected<int, int>
|
[[nodiscard]] std::expected<int, int>
|
||||||
NonBlockingClient::recv(std::span<char> buffer) {
|
NonBlockingClient::recv(std::span<std::byte> buffer) {
|
||||||
const int bytesReceived =
|
const int bytesReceived =
|
||||||
::recv(m_socket, (char*)buffer.data(), buffer.size(), 0);
|
::recv(m_socket, (char*)buffer.data(), buffer.size(), 0);
|
||||||
|
|
||||||
|
|||||||
@ -98,9 +98,8 @@ public:
|
|||||||
|
|
||||||
bool data_available();
|
bool data_available();
|
||||||
|
|
||||||
// TODO: Make this std::byte
|
[[nodiscard]] std::expected<int, int> recv(std::span<std::byte> buffer);
|
||||||
[[nodiscard]] std::expected<int, int> recv(std::span<char> buffer);
|
[[nodiscard]] std::expected<int, int> send(std::span<const std::byte> data);
|
||||||
[[nodiscard]] std::expected<int, int> send(std::span<const char> data);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_socket = -1;
|
int m_socket = -1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user