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
2100a913
Commit
2100a913
authored
Aug 06, 2010
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:zeromq/zeromq2
parents
78e9ee84
16b43e65
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
signaler.cpp
src/signaler.cpp
+17
-5
No files found.
src/signaler.cpp
View file @
2100a913
...
...
@@ -176,7 +176,10 @@ zmq::signaler_t::~signaler_t ()
void
zmq
::
signaler_t
::
send
(
const
command_t
&
cmd_
)
{
ssize_t
nbytes
=
send
(
w
,
&
cmd_
,
sizeof
(
command_t
),
0
);
ssize_t
nbytes
;
do
{
::
send
(
w
,
&
cmd_
,
sizeof
(
command_t
),
0
);
}
while
(
nbytes
==
-
1
&&
errno
==
EINTR
);
errno_assert
(
nbytes
!=
-
1
);
zmq_assert
(
nbytes
==
sizeof
(
command_t
));
}
...
...
@@ -194,7 +197,10 @@ bool zmq::signaler_t::recv (command_t &cmd_, bool block_)
}
bool
result
;
ssize_t
nbytes
=
recv
(
r
,
buffer
,
sizeof
(
command_t
),
0
);
ssize_t
nbytes
;
do
{
nbytes
=
::
recv
(
r
,
buffer
,
sizeof
(
command_t
),
0
);
}
while
(
nbytes
==
-
1
&&
errno
==
EINTR
);
if
(
nbytes
==
-
1
&&
errno
==
EAGAIN
)
{
result
=
false
;
}
...
...
@@ -249,7 +255,10 @@ void zmq::signaler_t::send (const command_t &cmd_)
{
// TODO: Note that send is a blocking operation.
// How should we behave if the command cannot be written to the signaler?
ssize_t
nbytes
=
::
send
(
w
,
&
cmd_
,
sizeof
(
command_t
),
0
);
ssize_t
nbytes
;
do
{
nbytes
=
::
send
(
w
,
&
cmd_
,
sizeof
(
command_t
),
0
);
}
while
(
nbytes
==
-
1
&&
errno
==
EINTR
);
errno_assert
(
nbytes
!=
-
1
);
// This should never happen as we've already checked that command size is
...
...
@@ -259,8 +268,11 @@ void zmq::signaler_t::send (const command_t &cmd_)
bool
zmq
::
signaler_t
::
recv
(
command_t
*
cmd_
,
bool
block_
)
{
ssize_t
nbytes
=
::
recv
(
r
,
cmd_
,
sizeof
(
command_t
),
block_
?
0
:
MSG_DONTWAIT
);
ssize_t
nbytes
;
do
{
nbytes
=
::
recv
(
r
,
cmd_
,
sizeof
(
command_t
),
block_
?
0
:
MSG_DONTWAIT
);
}
while
(
nbytes
==
-
1
&&
errno
==
EINTR
);
// If there's no signal available return false.
if
(
nbytes
==
-
1
&&
errno
==
EAGAIN
)
...
...
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