Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
a13eb1a9
Commit
a13eb1a9
authored
Jan 31, 2019
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: ipc_connector_t::_handle_valid is redundant
Solution: replace by checks against valid value of _handle
parent
065e8187
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
ipc_connecter.cpp
src/ipc_connecter.cpp
+5
-7
ipc_connecter.hpp
src/ipc_connecter.hpp
+0
-4
No files found.
src/ipc_connecter.cpp
View file @
a13eb1a9
...
...
@@ -60,7 +60,7 @@ zmq::ipc_connecter_t::ipc_connecter_t (class io_thread_t *io_thread_,
io_object_t
(
io_thread_
),
_addr
(
addr_
),
_s
(
retired_fd
),
_handle
_valid
(
false
),
_handle
(
static_cast
<
handle_t
>
(
NULL
)
),
_delayed_start
(
delayed_start_
),
_reconnect_timer_started
(
false
),
_session
(
session_
),
...
...
@@ -75,7 +75,7 @@ zmq::ipc_connecter_t::ipc_connecter_t (class io_thread_t *io_thread_,
zmq
::
ipc_connecter_t
::~
ipc_connecter_t
()
{
zmq_assert
(
!
_reconnect_timer_started
);
zmq_assert
(
!
_handle_valid
);
zmq_assert
(
_handle
==
static_cast
<
handle_t
>
(
NULL
)
);
zmq_assert
(
_s
==
retired_fd
);
}
...
...
@@ -94,9 +94,9 @@ void zmq::ipc_connecter_t::process_term (int linger_)
_reconnect_timer_started
=
false
;
}
if
(
_handle
_valid
)
{
if
(
_handle
)
{
rm_fd
(
_handle
);
_handle
_valid
=
false
;
_handle
=
static_cast
<
handle_t
>
(
NULL
)
;
}
if
(
_s
!=
retired_fd
)
...
...
@@ -117,7 +117,7 @@ void zmq::ipc_connecter_t::out_event ()
{
fd_t
fd
=
connect
();
rm_fd
(
_handle
);
_handle
_valid
=
false
;
_handle
=
static_cast
<
handle_t
>
(
NULL
)
;
// Handle the error condition by attempt to reconnect.
if
(
fd
==
retired_fd
)
{
...
...
@@ -154,14 +154,12 @@ void zmq::ipc_connecter_t::start_connecting ()
// Connect may succeed in synchronous manner.
if
(
rc
==
0
)
{
_handle
=
add_fd
(
_s
);
_handle_valid
=
true
;
out_event
();
}
// Connection establishment may be delayed. Poll for its completion.
else
if
(
rc
==
-
1
&&
errno
==
EINPROGRESS
)
{
_handle
=
add_fd
(
_s
);
_handle_valid
=
true
;
set_pollout
(
_handle
);
_socket
->
event_connect_delayed
(
_endpoint
,
zmq_errno
());
}
...
...
src/ipc_connecter.hpp
View file @
a13eb1a9
...
...
@@ -104,10 +104,6 @@ class ipc_connecter_t : public own_t, public io_object_t
// Handle corresponding to the listening socket.
handle_t
_handle
;
// If true file descriptor is registered with the poller and 'handle'
// contains valid value.
bool
_handle_valid
;
// If true, connecter is waiting a while before trying to connect.
const
bool
_delayed_start
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment