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
73e19527
Commit
73e19527
authored
Jun 22, 2013
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #588 from hurtonm/master
Small code cleanup
parents
2bf51247
084e8792
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
13 deletions
+9
-13
pipe.cpp
src/pipe.cpp
+8
-12
pipe.hpp
src/pipe.hpp
+1
-1
No files found.
src/pipe.cpp
View file @
73e19527
...
@@ -113,7 +113,7 @@ bool zmq::pipe_t::check_read ()
...
@@ -113,7 +113,7 @@ bool zmq::pipe_t::check_read ()
msg_t
msg
;
msg_t
msg
;
bool
ok
=
inpipe
->
read
(
&
msg
);
bool
ok
=
inpipe
->
read
(
&
msg
);
zmq_assert
(
ok
);
zmq_assert
(
ok
);
delimit
();
process_delimiter
();
return
false
;
return
false
;
}
}
...
@@ -134,7 +134,7 @@ bool zmq::pipe_t::read (msg_t *msg_)
...
@@ -134,7 +134,7 @@ bool zmq::pipe_t::read (msg_t *msg_)
// If delimiter was read, start termination process of the pipe.
// If delimiter was read, start termination process of the pipe.
if
(
msg_
->
is_delimiter
())
{
if
(
msg_
->
is_delimiter
())
{
delimit
();
process_delimiter
();
return
false
;
return
false
;
}
}
...
@@ -414,22 +414,18 @@ int zmq::pipe_t::compute_lwm (int hwm_)
...
@@ -414,22 +414,18 @@ int zmq::pipe_t::compute_lwm (int hwm_)
return
result
;
return
result
;
}
}
void
zmq
::
pipe_t
::
delimit
()
void
zmq
::
pipe_t
::
process_delimiter
()
{
{
if
(
state
==
active
)
{
zmq_assert
(
state
==
active
state
=
delimiter_received
;
||
state
==
waiting_for_delimiter
);
return
;
}
if
(
state
==
waiting_for_delimiter
)
{
if
(
state
==
active
)
state
=
delimiter_received
;
else
{
outpipe
=
NULL
;
outpipe
=
NULL
;
send_pipe_term_ack
(
peer
);
send_pipe_term_ack
(
peer
);
state
=
term_ack_sent
;
state
=
term_ack_sent
;
return
;
}
}
// Delimiter in any other state is invalid.
zmq_assert
(
false
);
}
}
void
zmq
::
pipe_t
::
hiccup
()
void
zmq
::
pipe_t
::
hiccup
()
...
...
src/pipe.hpp
View file @
73e19527
...
@@ -120,7 +120,7 @@ namespace zmq
...
@@ -120,7 +120,7 @@ namespace zmq
void
process_pipe_term_ack
();
void
process_pipe_term_ack
();
// Handler for delimiter read from the pipe.
// Handler for delimiter read from the pipe.
void
delimit
();
void
process_delimiter
();
// Constructor is private. Pipe can only be created using
// Constructor is private. Pipe can only be created using
// pipepair function.
// pipepair function.
...
...
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