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
dc949624
Commit
dc949624
authored
Jun 05, 2015
by
Richard Newton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle infinite hwms properly
parent
15eecf4c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
pipe.cpp
src/pipe.cpp
+12
-2
test_hwm.cpp
tests/test_hwm.cpp
+2
-2
No files found.
src/pipe.cpp
View file @
dc949624
...
...
@@ -520,8 +520,18 @@ void zmq::pipe_t::hiccup ()
void
zmq
::
pipe_t
::
set_hwms
(
int
inhwm_
,
int
outhwm_
)
{
lwm
=
compute_lwm
(
inhwm_
+
inhwmboost
);
hwm
=
outhwm_
+
outhwmboost
;
int
in
=
inhwm_
+
inhwmboost
;
int
out
=
outhwm_
+
outhwmboost
;
// if either send or recv side has hwm <= 0 it means infinite so we should set hwms infinite
if
(
inhwm_
<=
0
||
inhwmboost
<=
0
)
in
=
0
;
if
(
outhwm_
<=
0
||
outhwmboost
<=
0
)
out
=
0
;
lwm
=
compute_lwm
(
in
);
hwm
=
out
;
}
void
zmq
::
pipe_t
::
set_hwms_boost
(
int
inhwmboost_
,
int
outhwmboost_
)
...
...
tests/test_hwm.cpp
View file @
dc949624
...
...
@@ -278,13 +278,13 @@ int main (void)
count
=
test_inproc_connect_first
(
0
,
0
);
assert
(
count
==
MAX_SENDS
);
// Infinite
send
buffer
// Infinite
receive
buffer
count
=
test_inproc_bind_first
(
1
,
0
);
assert
(
count
==
MAX_SENDS
);
count
=
test_inproc_connect_first
(
1
,
0
);
assert
(
count
==
MAX_SENDS
);
// Infinite
receive
buffer
// Infinite
send
buffer
count
=
test_inproc_bind_first
(
0
,
1
);
assert
(
count
==
MAX_SENDS
);
count
=
test_inproc_connect_first
(
0
,
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