rsocket-cpp icon indicating copy to clipboard operation
rsocket-cpp copied to clipboard

Reimplement KeepaliveTimer using asynctimeout

Open yschimke opened this issue 7 years ago • 0 comments

Current approach is awkward to cancel, would be cleaner to use AsyncTimeout.

  timeout_ = folly::AsyncTimeout::schedule(	
      std::chrono::milliseconds(heartbeatIntervalMs_),	
      eventBase_,	
      [this]() noexcept { heartbeat(); });
...
timeout_->scheduleTimeout(heartbeatIntervalMs_);

yschimke avatar Jul 25 '17 10:07 yschimke