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
228426ac
Commit
228426ac
authored
Aug 12, 2014
by
Martin Hurton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
bb6d18d5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
46 deletions
+15
-46
dist.cpp
src/dist.cpp
+4
-14
options.cpp
src/options.cpp
+3
-15
options.hpp
src/options.hpp
+0
-3
pipe.cpp
src/pipe.cpp
+1
-1
pipe.hpp
src/pipe.hpp
+3
-3
xpub.cpp
src/xpub.cpp
+4
-10
No files found.
src/dist.cpp
View file @
228426ac
...
...
@@ -196,21 +196,11 @@ bool zmq::dist_t::write (pipe_t *pipe_, msg_t *msg_)
bool
zmq
::
dist_t
::
check_hwm
()
{
// If there are no matching pipes available, there is nothing to write.
bool
pipes_hwm_ok
=
true
;
if
(
matching
==
0
)
{
return
true
;
}
for
(
pipes_t
::
size_type
i
=
0
;
i
<
matching
;
++
i
)
{
if
(
!
pipes
[
i
]
->
check_hwm
())
{
pipes_hwm_ok
=
false
;
break
;
}
}
for
(
pipes_t
::
size_type
i
=
0
;
i
<
matching
;
++
i
)
if
(
!
pipes
[
i
]
->
check_hwm
())
return
false
;
return
pipes_hwm_ok
;
return
true
;
}
src/options.cpp
View file @
228426ac
...
...
@@ -409,7 +409,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
}
break
;
# endif
case
ZMQ_CONFLATE
:
if
(
is_int
&&
(
value
==
0
||
value
==
1
))
{
conflate
=
(
value
!=
0
);
...
...
@@ -458,12 +458,6 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
return
0
;
}
break
;
case
ZMQ_XPUB_NODROP
:
{
pub_nodrop
=
true
;
return
0
;
}
break
;
default
:
#if defined (ZMQ_ACT_MILITANT)
...
...
@@ -558,7 +552,7 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
return
0
;
}
break
;
case
ZMQ_TYPE
:
if
(
is_int
)
{
*
value
=
type
;
...
...
@@ -770,7 +764,7 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
return
0
;
}
break
;
// If libgssapi isn't installed, these options provoke EINVAL
# ifdef HAVE_LIBGSSAPI_KRB5
case
ZMQ_GSSAPI_SERVER
:
...
...
@@ -811,12 +805,6 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
}
break
;
case
ZMQ_XPUB_NODROP
:
if
(
is_int
)
{
*
value
=
pub_nodrop
;
return
0
;
}
break
;
default
:
#if defined (ZMQ_ACT_MILITANT)
malformed
=
false
;
...
...
src/options.hpp
View file @
228426ac
...
...
@@ -179,9 +179,6 @@ namespace zmq
// close socket. Default is 30 secs. 0 means no handshake timeout.
int
handshake_ivl
;
// flag if PUB socket should not drop messages if reaching HWM
bool
pub_nodrop
;
};
}
...
...
src/pipe.cpp
View file @
228426ac
...
...
@@ -501,7 +501,7 @@ void zmq::pipe_t::set_hwms (int inhwm_, int outhwm_)
hwm
=
outhwm_
;
}
bool
zmq
::
pipe_t
::
check_hwm
()
bool
zmq
::
pipe_t
::
check_hwm
()
const
{
bool
full
=
hwm
>
0
&&
msgs_written
-
peers_msgs_read
>=
uint64_t
(
hwm
-
1
);
return
(
!
full
);
...
...
src/pipe.hpp
View file @
228426ac
...
...
@@ -69,7 +69,7 @@ namespace zmq
// This allows pipepair to create pipe objects.
friend
int
pipepair
(
zmq
::
object_t
*
parents_
[
2
],
zmq
::
pipe_t
*
pipes_
[
2
],
int
hwms_
[
2
],
bool
conflate_
[
2
]);
public
:
// Specifies the object to send events to.
...
...
@@ -105,7 +105,7 @@ namespace zmq
// all the messages on the fly. Causes 'hiccuped' event to be generated
// in the peer.
void
hiccup
();
// Ensure the pipe wont block on receiving pipe_term.
void
set_nodelay
();
...
...
@@ -119,7 +119,7 @@ namespace zmq
void
set_hwms
(
int
inhwm_
,
int
outhwm_
);
// check HWM
bool
check_hwm
();
bool
check_hwm
()
const
;
// provide a way to link pipe to engine fd. Set on session initialization
fd_t
assoc_fd
;
//=retired_fd
private
:
...
...
src/xpub.cpp
View file @
228426ac
...
...
@@ -98,14 +98,10 @@ int zmq::xpub_t::xsetsockopt (int option_, const void *optval_,
errno
=
EINVAL
;
return
-
1
;
}
if
(
option_
==
ZMQ_XPUB_VERBOSE
)
{
if
(
option_
==
ZMQ_XPUB_VERBOSE
)
verbose
=
(
*
static_cast
<
const
int
*>
(
optval_
)
!=
0
);
}
else
if
(
option_
==
ZMQ_XPUB_NODROP
)
{
else
nodrop
=
(
*
static_cast
<
const
int
*>
(
optval_
)
!=
0
);
}
else
{
return
-
1
;
}
return
0
;
}
...
...
@@ -135,10 +131,8 @@ int zmq::xpub_t::xsend (msg_t *msg_)
subscriptions
.
match
((
unsigned
char
*
)
msg_
->
data
(),
msg_
->
size
(),
mark_as_matching
,
this
);
if
(
nodrop
&&
!
dist
.
check_hwm
())
{
if
(
nodrop
&&
!
dist
.
check_hwm
())
return
EAGAIN
;
}
// Send the message to all the pipes that were marked as matching
// in the previous step.
...
...
@@ -163,7 +157,7 @@ bool zmq::xpub_t::xhas_out ()
int
zmq
::
xpub_t
::
xrecv
(
msg_t
*
msg_
)
{
// If there is at least one
// If there is at least one
if
(
pending_data
.
empty
())
{
errno
=
EAGAIN
;
return
-
1
;
...
...
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