summaryrefslogtreecommitdiff
path: root/src/tcp_connecter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tcp_connecter.cpp')
-rw-r--r--src/tcp_connecter.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tcp_connecter.cpp b/src/tcp_connecter.cpp
index 2b4f657..5007570 100644
--- a/src/tcp_connecter.cpp
+++ b/src/tcp_connecter.cpp
@@ -52,7 +52,7 @@ xs::tcp_connecter_t::tcp_connecter_t (class io_thread_t *io_thread_,
own_t (io_thread_, options_),
io_object_t (io_thread_),
s (retired_fd),
- handle_valid (false),
+ handle (NULL),
wait (wait_),
session (session_),
current_reconnect_ivl(options.reconnect_ivl),
@@ -71,7 +71,7 @@ xs::tcp_connecter_t::~tcp_connecter_t ()
rm_timer (reconnect_timer);
reconnect_timer = NULL;
}
- if (handle_valid)
+ if (handle)
rm_fd (handle);
if (s != retired_fd)
@@ -98,7 +98,7 @@ void xs::tcp_connecter_t::out_event (fd_t fd_)
{
fd_t fd = connect ();
rm_fd (handle);
- handle_valid = false;
+ handle = NULL;
// Handle the error condition by attempt to reconnect.
if (fd == retired_fd) {
@@ -136,16 +136,16 @@ void xs::tcp_connecter_t::start_connecting ()
// Connect may succeed in synchronous manner.
if (rc == 0) {
+ xs_assert (!handle);
handle = add_fd (s);
- handle_valid = true;
out_event (s);
return;
}
// Connection establishment may be delayed. Poll for its completion.
else if (rc == -1 && errno == EAGAIN) {
+ xs_assert (!handle);
handle = add_fd (s);
- handle_valid = true;
set_pollout (handle);
return;
}