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
8c25bab3
Commit
8c25bab3
authored
Feb 10, 2010
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZMQII-70: zmq_poll on win32 fails with EINVAL
parent
8f86cac2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
zmq.cpp
src/zmq.cpp
+14
-13
No files found.
src/zmq.cpp
View file @
8c25bab3
...
@@ -505,32 +505,32 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
...
@@ -505,32 +505,32 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
// First iteration just check for events, don't block. Waiting would
// First iteration just check for events, don't block. Waiting would
// prevent exiting on any events that may already been signaled on
// prevent exiting on any events that may already been signaled on
// 0MQ sockets.
// 0MQ sockets.
int
rc
=
select
(
maxfd
,
&
pollset_in
,
&
pollset_out
,
&
pollset_err
,
fd_set
inset
,
outset
,
errset
;
&
zero_timeout
);
memcpy
(
&
inset
,
&
pollset_in
,
sizeof
(
fd_set
));
memcpy
(
&
outset
,
&
pollset_out
,
sizeof
(
fd_set
));
memcpy
(
&
errset
,
&
pollset_err
,
sizeof
(
fd_set
));
int
rc
=
select
(
maxfd
,
&
inset
,
&
outset
,
&
errset
,
&
zero_timeout
);
#if defined ZMQ_HAVE_WINDOWS
#if defined ZMQ_HAVE_WINDOWS
wsa_assert
(
rc
!=
SOCKET_ERROR
);
wsa_assert
(
rc
!=
SOCKET_ERROR
);
#else
#else
if
(
rc
==
-
1
&&
errno
==
EINTR
)
errno_assert
(
rc
!=
-
1
||
errno
!=
EINTR
);
break
;
errno_assert
(
rc
>=
0
);
#endif
#endif
while
(
true
)
{
while
(
true
)
{
// Process 0MQ commands if needed.
// Process 0MQ commands if needed.
if
(
nsockets
&&
FD_ISSET
(
notify_fd
,
&
pollset_in
))
if
(
nsockets
&&
FD_ISSET
(
notify_fd
,
&
inset
))
app_thread
->
process_commands
(
false
,
false
);
app_thread
->
process_commands
(
false
,
false
);
// Check for the events.
// Check for the events.
int
pollfd_pos
=
0
;
for
(
int
i
=
0
;
i
!=
nitems_
;
i
++
)
{
for
(
int
i
=
0
;
i
!=
nitems_
;
i
++
)
{
// If the poll item is a raw file descriptor, simply convert
// If the poll item is a raw file descriptor, simply convert
// the events to zmq_pollitem_t-style format.
// the events to zmq_pollitem_t-style format.
if
(
!
items_
[
i
].
socket
)
{
if
(
!
items_
[
i
].
socket
)
{
items_
[
i
].
revents
=
items_
[
i
].
revents
=
(
FD_ISSET
(
items_
[
i
].
fd
,
&
pollset_in
)
?
ZMQ_POLLIN
:
0
)
|
(
FD_ISSET
(
items_
[
i
].
fd
,
&
inset
)
?
ZMQ_POLLIN
:
0
)
|
(
FD_ISSET
(
items_
[
i
].
fd
,
&
pollset_ou
t
)
?
ZMQ_POLLOUT
:
0
);
(
FD_ISSET
(
items_
[
i
].
fd
,
&
outse
t
)
?
ZMQ_POLLOUT
:
0
);
if
(
items_
[
i
].
revents
)
if
(
items_
[
i
].
revents
)
nevents
++
;
nevents
++
;
continue
;
continue
;
...
@@ -553,14 +553,15 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
...
@@ -553,14 +553,15 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
break
;
break
;
// Wait for events.
// Wait for events.
int
rc
=
select
(
maxfd
,
&
pollset_in
,
&
pollset_out
,
&
pollset_err
,
memcpy
(
&
inset
,
&
pollset_in
,
sizeof
(
fd_set
));
memcpy
(
&
outset
,
&
pollset_out
,
sizeof
(
fd_set
));
memcpy
(
&
errset
,
&
pollset_err
,
sizeof
(
fd_set
));
int
rc
=
select
(
maxfd
,
&
inset
,
&
outset
,
&
errset
,
block
?
NULL
:
&
timeout
);
block
?
NULL
:
&
timeout
);
#if defined ZMQ_HAVE_WINDOWS
#if defined ZMQ_HAVE_WINDOWS
wsa_assert
(
rc
!=
SOCKET_ERROR
);
wsa_assert
(
rc
!=
SOCKET_ERROR
);
#else
#else
if
(
rc
==
-
1
&&
errno
==
EINTR
)
errno_assert
(
rc
!=
-
1
||
errno
!=
EINTR
);
break
;
errno_assert
(
rc
>=
0
);
#endif
#endif
// If timeout was hit with no events signaled, return zero.
// If timeout was hit with no events signaled, return zero.
...
...
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