Add keepalive comment messages, per spec
This commit is contained in:
6
stream.h
6
stream.h
@@ -15,7 +15,8 @@ class Stream {
|
||||
|
||||
void OnClose(const std::function<void()>& callback);
|
||||
|
||||
bool WriteEvent(const std::string& data, uint64_t id=0, const std::string& type="");
|
||||
bool WriteEvent(const std::string_view& data, uint64_t id=0, const std::string& type="");
|
||||
bool WriteRaw(const std::string_view& data);
|
||||
bool End();
|
||||
void Close();
|
||||
|
||||
@@ -25,7 +26,8 @@ class Stream {
|
||||
|
||||
std::function<void()> on_close_;
|
||||
|
||||
std::mutex mu_;
|
||||
// TODO: What exactly is this protecting?
|
||||
std::recursive_mutex mu_;
|
||||
std::chrono::steady_clock::time_point last_message_time_;
|
||||
Stream* fresher_;
|
||||
Stream* staler_;
|
||||
|
||||
Reference in New Issue
Block a user