net: remove Sock default constructor, it's not necessary

This commit is contained in:
Vasil Dimov
2021-05-28 15:37:43 +02:00
parent 7829272f78
commit 5086a99b84
5 changed files with 14 additions and 13 deletions

View File

@@ -106,10 +106,10 @@ constexpr auto ALL_NETWORKS = std::array{
class StaticContentsSock : public Sock
{
public:
explicit StaticContentsSock(const std::string& contents) : m_contents{contents}
explicit StaticContentsSock(const std::string& contents)
: Sock{INVALID_SOCKET},
m_contents{contents}
{
// Just a dummy number that is not INVALID_SOCKET.
m_socket = INVALID_SOCKET - 1;
}
~StaticContentsSock() override { m_socket = INVALID_SOCKET; }
@@ -192,6 +192,11 @@ public:
return true;
}
bool IsConnected(std::string&) const override
{
return true;
}
private:
const std::string m_contents;
mutable size_t m_consumed{0};