Skip to content

Commit f1cca82

Browse files
util: Changed Timer handler signature to just void()
1 parent 32daafa commit f1cca82

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

api/net/tcp/connection.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ class Connection : public std::enable_shared_from_this<Connection> {
878878
/*
879879
When retransmission times out.
880880
*/
881-
void rtx_timeout(Timer::id_t);
881+
void rtx_timeout();
882882

883883
/** Start the timewait timeout for 2*MSL */
884884
void timewait_start();
@@ -890,7 +890,7 @@ class Connection : public std::enable_shared_from_this<Connection> {
890890
void timewait_restart();
891891

892892
/** When timewait timer times out */
893-
void timewait_timeout(Timer::id_t);
893+
void timewait_timeout();
894894

895895
/*
896896
Tell the host (TCP) to delete this connection.

api/util/timer.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Timer {
3131
public:
3232
using id_t = Timers::id_t;
3333
using duration_t = Timers::duration_t;
34-
using handler_t = Timers::handler_t;
34+
using handler_t = delegate<void()>;
3535

3636
/**
3737
* @brief Constructs a Timer without a handler
@@ -122,7 +122,7 @@ class Timer {
122122
*/
123123
inline void _internal_timeout(id_t id);
124124

125-
void _do_nothing(id_t) {}
125+
void _do_nothing() {}
126126

127127
} __attribute__((packed)); // < class Timer
128128

@@ -146,9 +146,9 @@ inline void Timer::restart(duration_t when) {
146146
start(when);
147147
}
148148

149-
inline void Timer::_internal_timeout(id_t id) {
149+
inline void Timer::_internal_timeout(id_t) {
150150
id_ = Timers::UNUSED_ID;
151-
on_timeout_(id);
151+
on_timeout_();
152152
}
153153

154154
#endif

src/net/tcp/connection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ void Connection::rtx_clear() {
719719
MUST be re-initialized to 3 seconds when data transmission
720720
begins (i.e., after the three-way handshake completes).
721721
*/
722-
void Connection::rtx_timeout(Timer::id_t) {
722+
void Connection::rtx_timeout() {
723723
debug("<TCP::Connection::RTX@timeout> %s Timed out (%f). FS: %u\n",
724724
to_string().c_str(), flight_size());
725725

@@ -806,7 +806,7 @@ void Connection::timewait_restart() {
806806
timewait_timer.restart(timeout);
807807
}
808808

809-
void Connection::timewait_timeout(Timer::id_t) {
809+
void Connection::timewait_timeout() {
810810
debug("<Connection> TimeWait timed out, closing.\n");
811811
signal_close();
812812
}

0 commit comments

Comments
 (0)