Give the connection object to the timeout as well
This commit is contained in:
parent
f7838492fb
commit
83621790f4
|
|
@ -28,10 +28,11 @@ public:
|
|||
* do not implement it, certain methods that fail immediately
|
||||
* will not be reported.
|
||||
*
|
||||
* @param connection the connection that needs the timeout
|
||||
* @param timeout number of seconds to wait
|
||||
* @param callback function to execute once time runs out
|
||||
*/
|
||||
virtual void setTimeout(double seconds, const std::function<void()>& callback) {}
|
||||
virtual void setTimeout(Connection *connection, double seconds, const std::function<void()>& callback) {}
|
||||
|
||||
/**
|
||||
* Method that is called when data needs to be sent over the network
|
||||
|
|
|
|||
|
|
@ -553,7 +553,7 @@ Deferred<Arguments...>& ChannelImpl::send(const Frame &frame, const char *messag
|
|||
// register an error on the deferred handler
|
||||
// after a timeout, so it gets called only
|
||||
// after a possible handler was installed.
|
||||
_connection->_handler->setTimeout(0, [handler, message]() {
|
||||
_connection->_handler->setTimeout(_connection->_parent, 0, [handler, message]() {
|
||||
// emit an error on the handler
|
||||
handler->error(message);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue