Switch to single-threaded epoll-based operation

This commit is contained in:
Ian Gulliver
2019-05-04 07:21:52 +00:00
parent 87bc2c1611
commit ac0d3e2816
8 changed files with 95 additions and 45 deletions

View File

@@ -6,14 +6,8 @@ class StreamBuffer : public Buffer {
public:
StreamBuffer(int sock, size_t size);
[[nodiscard]] bool BufferAtLeast(size_t len);
[[nodiscard]] const char *Read(size_t len) override;
template<class T> [[nodiscard]] const T *ReadObj();
[[nodiscard]] bool Refill();
private:
int sock_;
};
template<class T> const T *StreamBuffer::ReadObj() {
return reinterpret_cast<const T*>(Read(sizeof(T)));
}