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
de339785
Commit
de339785
authored
Nov 09, 2012
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #464 from hurtonm/code_cleanup
Code cleanup
parents
ec082414
ea19b7b6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
34 deletions
+17
-34
dealer.cpp
src/dealer.cpp
+1
-11
options.cpp
src/options.cpp
+1
-1
req.cpp
src/req.cpp
+0
-1
session_base.cpp
src/session_base.cpp
+0
-2
socket_base.cpp
src/socket_base.cpp
+15
-19
No files found.
src/dealer.cpp
View file @
de339785
...
...
@@ -35,8 +35,6 @@ zmq::dealer_t::dealer_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
// be noone to receive the replies anyway.
// options.delay_on_close = false;
options
.
recv_identity
=
true
;
prefetched_msg
.
init
();
}
...
...
@@ -73,15 +71,7 @@ int zmq::dealer_t::xrecv (msg_t *msg_, int flags_)
return
0
;
}
// DEALER socket doesn't use identities. We can safely drop it and
while
(
true
)
{
int
rc
=
fq
.
recv
(
msg_
);
if
(
rc
!=
0
)
return
rc
;
if
(
likely
(
!
(
msg_
->
flags
()
&
msg_t
::
identity
)))
break
;
}
return
0
;
return
fq
.
recv
(
msg_
);
}
bool
zmq
::
dealer_t
::
xhas_in
()
...
...
src/options.cpp
View file @
de339785
...
...
@@ -49,13 +49,13 @@ zmq::options_t::options_t () :
delay_on_disconnect
(
true
),
filter
(
false
),
recv_identity
(
false
),
raw_sock
(
false
),
tcp_keepalive
(
-
1
),
tcp_keepalive_cnt
(
-
1
),
tcp_keepalive_idle
(
-
1
),
tcp_keepalive_intvl
(
-
1
),
socket_id
(
0
)
{
raw_sock
=
false
;
}
int
zmq
::
options_t
::
setsockopt
(
int
option_
,
const
void
*
optval_
,
...
...
src/req.cpp
View file @
de339785
...
...
@@ -147,7 +147,6 @@ zmq::req_session_t::req_session_t (io_thread_t *io_thread_, bool connect_,
zmq
::
req_session_t
::~
req_session_t
()
{
state
=
options
.
recv_identity
?
identity
:
bottom
;
}
int
zmq
::
req_session_t
::
push_msg
(
msg_t
*
msg_
)
...
...
src/session_base.cpp
View file @
de339785
...
...
@@ -20,8 +20,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
#include "session_base.hpp"
#include "i_engine.hpp"
#include "err.hpp"
...
...
src/socket_base.cpp
View file @
de339785
...
...
@@ -428,15 +428,11 @@ int zmq::socket_base_t::connect (const char *addr_)
// The total HWM for an inproc connection should be the sum of
// the binder's HWM and the connector's HWM.
int
sndhwm
;
int
rcvhwm
;
if
(
options
.
sndhwm
==
0
||
peer
.
options
.
rcvhwm
==
0
)
sndhwm
=
0
;
else
int
sndhwm
=
0
;
if
(
options
.
sndhwm
!=
0
&&
peer
.
options
.
rcvhwm
!=
0
)
sndhwm
=
options
.
sndhwm
+
peer
.
options
.
rcvhwm
;
if
(
options
.
rcvhwm
==
0
||
peer
.
options
.
sndhwm
==
0
)
rcvhwm
=
0
;
else
int
rcvhwm
=
0
;
if
(
options
.
rcvhwm
!=
0
&&
peer
.
options
.
sndhwm
!=
0
)
rcvhwm
=
options
.
rcvhwm
+
peer
.
options
.
sndhwm
;
// Create a bi-directional pipe to connect the peers.
...
...
@@ -1034,7 +1030,7 @@ int zmq::socket_base_t::monitor (const char *addr_, int events_)
// Register events to monitor
monitor_events
=
events_
;
monitor_socket
=
zmq_socket
(
get_ctx
(),
ZMQ_PAIR
);
monitor_socket
=
zmq_socket
(
get_ctx
(),
ZMQ_PAIR
);
if
(
monitor_socket
==
NULL
)
return
-
1
;
...
...
@@ -1056,7 +1052,7 @@ void zmq::socket_base_t::event_connected (const char *addr_, int fd_)
if
(
monitor_events
&
ZMQ_EVENT_CONNECTED
)
{
zmq_event_t
event
;
event
.
event
=
ZMQ_EVENT_CONNECTED
;
event
.
data
.
connected
.
addr
=
(
char
*
)
addr_
;
event
.
data
.
connected
.
addr
=
const_cast
<
char
*>
(
addr_
)
;
event
.
data
.
connected
.
fd
=
fd_
;
monitor_event
(
event
);
}
...
...
@@ -1067,7 +1063,7 @@ void zmq::socket_base_t::event_connect_delayed (const char *addr_, int err_)
if
(
monitor_events
&
ZMQ_EVENT_CONNECT_DELAYED
)
{
zmq_event_t
event
;
event
.
event
=
ZMQ_EVENT_CONNECT_DELAYED
;
event
.
data
.
connected
.
addr
=
(
char
*
)
addr_
;
event
.
data
.
connected
.
addr
=
const_cast
<
char
*>
(
addr_
)
;
event
.
data
.
connect_delayed
.
err
=
err_
;
monitor_event
(
event
);
}
...
...
@@ -1078,7 +1074,7 @@ void zmq::socket_base_t::event_connect_retried (const char *addr_, int interval_
if
(
monitor_events
&
ZMQ_EVENT_CONNECT_RETRIED
)
{
zmq_event_t
event
;
event
.
event
=
ZMQ_EVENT_CONNECT_RETRIED
;
event
.
data
.
connected
.
addr
=
(
char
*
)
addr_
;
event
.
data
.
connected
.
addr
=
const_cast
<
char
*>
(
addr_
)
;
event
.
data
.
connect_retried
.
interval
=
interval_
;
monitor_event
(
event
);
}
...
...
@@ -1089,7 +1085,7 @@ void zmq::socket_base_t::event_listening (const char *addr_, int fd_)
if
(
monitor_events
&
ZMQ_EVENT_LISTENING
)
{
zmq_event_t
event
;
event
.
event
=
ZMQ_EVENT_LISTENING
;
event
.
data
.
connected
.
addr
=
(
char
*
)
addr_
;
event
.
data
.
connected
.
addr
=
const_cast
<
char
*>
(
addr_
)
;
event
.
data
.
listening
.
fd
=
fd_
;
monitor_event
(
event
);
}
...
...
@@ -1100,7 +1096,7 @@ void zmq::socket_base_t::event_bind_failed (const char *addr_, int err_)
if
(
monitor_events
&
ZMQ_EVENT_BIND_FAILED
)
{
zmq_event_t
event
;
event
.
event
=
ZMQ_EVENT_BIND_FAILED
;
event
.
data
.
connected
.
addr
=
(
char
*
)
addr_
;
event
.
data
.
connected
.
addr
=
const_cast
<
char
*>
(
addr_
)
;
event
.
data
.
bind_failed
.
err
=
err_
;
monitor_event
(
event
);
}
...
...
@@ -1111,7 +1107,7 @@ void zmq::socket_base_t::event_accepted (const char *addr_, int fd_)
if
(
monitor_events
&
ZMQ_EVENT_ACCEPTED
)
{
zmq_event_t
event
;
event
.
event
=
ZMQ_EVENT_ACCEPTED
;
event
.
data
.
connected
.
addr
=
(
char
*
)
addr_
;
event
.
data
.
connected
.
addr
=
const_cast
<
char
*>
(
addr_
)
;
event
.
data
.
accepted
.
fd
=
fd_
;
monitor_event
(
event
);
}
...
...
@@ -1122,7 +1118,7 @@ void zmq::socket_base_t::event_accept_failed (const char *addr_, int err_)
if
(
monitor_events
&
ZMQ_EVENT_ACCEPT_FAILED
)
{
zmq_event_t
event
;
event
.
event
=
ZMQ_EVENT_ACCEPT_FAILED
;
event
.
data
.
connected
.
addr
=
(
char
*
)
addr_
;
event
.
data
.
connected
.
addr
=
const_cast
<
char
*>
(
addr_
)
;
event
.
data
.
accept_failed
.
err
=
err_
;
monitor_event
(
event
);
}
...
...
@@ -1133,7 +1129,7 @@ void zmq::socket_base_t::event_closed (const char *addr_, int fd_)
if
(
monitor_events
&
ZMQ_EVENT_CLOSED
)
{
zmq_event_t
event
;
event
.
event
=
ZMQ_EVENT_CLOSED
;
event
.
data
.
connected
.
addr
=
(
char
*
)
addr_
;
event
.
data
.
connected
.
addr
=
const_cast
<
char
*>
(
addr_
)
;
event
.
data
.
closed
.
fd
=
fd_
;
monitor_event
(
event
);
}
...
...
@@ -1144,7 +1140,7 @@ void zmq::socket_base_t::event_close_failed (const char *addr_, int err_)
if
(
monitor_events
&
ZMQ_EVENT_CLOSE_FAILED
)
{
zmq_event_t
event
;
event
.
event
=
ZMQ_EVENT_CLOSE_FAILED
;
event
.
data
.
connected
.
addr
=
(
char
*
)
addr_
;
event
.
data
.
connected
.
addr
=
const_cast
<
char
*>
(
addr_
)
;
event
.
data
.
close_failed
.
err
=
err_
;
monitor_event
(
event
);
}
...
...
@@ -1155,7 +1151,7 @@ void zmq::socket_base_t::event_disconnected (const char *addr_, int fd_)
if
(
monitor_events
&
ZMQ_EVENT_DISCONNECTED
)
{
zmq_event_t
event
;
event
.
event
=
ZMQ_EVENT_DISCONNECTED
;
event
.
data
.
connected
.
addr
=
(
char
*
)
addr_
;
event
.
data
.
connected
.
addr
=
const_cast
<
char
*>
(
addr_
)
;
event
.
data
.
disconnected
.
fd
=
fd_
;
monitor_event
(
event
);
}
...
...
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