Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Commit

Permalink
Fix bug where connect timer wasn't being honored.
Browse files Browse the repository at this point in the history
ev_timer_start was being called w/out ev_timer_set.
  • Loading branch information
Jamie Turner committed Sep 17, 2013
1 parent 946fe9e commit 6942173
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Stcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,9 @@ void Stcp_connect_cb(
/* let's restart the timer */
ev_io_stop(the_runtime->the_loop, &s->connect_io);
close(s->connect_fd);
ev_timer_set(
&s->connect_timer,
s->opt->reconnect_interval, 0);
ev_timer_start(the_runtime->the_loop, &s->connect_timer);
}
}
Expand Down Expand Up @@ -604,6 +607,9 @@ void Stcp_socket_start_connect(nitro_tcp_socket_t *s) {
ev_io_start(the_runtime->the_loop, &s->connect_io);
} else {
close(s->connect_fd);
ev_timer_set(
&s->connect_timer,
s->opt->reconnect_interval, 0);
ev_timer_start(the_runtime->the_loop, &s->connect_timer);
}
}
Expand Down

0 comments on commit 6942173

Please sign in to comment.