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
e6ca5da1
Commit
e6ca5da1
authored
Sep 22, 2009
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Windows build fixed
parent
b15f6959
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
15 deletions
+21
-15
fd_signaler.cpp
src/fd_signaler.cpp
+16
-15
p2p.cpp
src/p2p.cpp
+3
-0
rep.cpp
src/rep.cpp
+2
-0
No files found.
src/fd_signaler.cpp
View file @
e6ca5da1
...
@@ -70,6 +70,7 @@ uint64_t zmq::fd_signaler_t::poll ()
...
@@ -70,6 +70,7 @@ uint64_t zmq::fd_signaler_t::poll ()
// TODO: Can we do a blocking read on non-blocking eventfd?
// TODO: Can we do a blocking read on non-blocking eventfd?
// It's not needed as for now, so let it stay unimplemented.
// It's not needed as for now, so let it stay unimplemented.
zmq_assert
(
false
);
zmq_assert
(
false
);
return
0
;
}
}
uint64_t
zmq
::
fd_signaler_t
::
check
()
uint64_t
zmq
::
fd_signaler_t
::
check
()
...
@@ -129,7 +130,13 @@ zmq::fd_signaler_t::fd_signaler_t ()
...
@@ -129,7 +130,13 @@ zmq::fd_signaler_t::fd_signaler_t ()
// Accept connection from w.
// Accept connection from w.
r
=
accept
(
listener
,
NULL
,
NULL
);
r
=
accept
(
listener
,
NULL
,
NULL
);
wsa_assert
(
r
!=
INVALID_SOCKET
);
wsa_assert
(
r
!=
INVALID_SOCKET
);
// Set the read site of the pair to non-blocking mode.
//unsigned long argp = 1;
//rc = ioctlsocket (r, FIONBIO, &argp);
//wsa_assert (rc != SOCKET_ERROR);
// We don't need the listening socket anymore. Close it.
rc
=
closesocket
(
listener
);
rc
=
closesocket
(
listener
);
wsa_assert
(
rc
!=
SOCKET_ERROR
);
wsa_assert
(
rc
!=
SOCKET_ERROR
);
}
}
...
@@ -156,25 +163,19 @@ void zmq::fd_signaler_t::signal (int signal_)
...
@@ -156,25 +163,19 @@ void zmq::fd_signaler_t::signal (int signal_)
uint64_t
zmq
::
fd_signaler_t
::
poll
()
uint64_t
zmq
::
fd_signaler_t
::
poll
()
{
{
// If there are signals available, return straight away.
// TODO: Can we do a blocking read on non-blocking socket?
uint64_t
signals
=
check
();
// It's not needed as for now, so let it stay unimplemented.
if
(
signals
)
zmq_assert
(
false
);
return
signals
;
return
0
;
// If there are no signals, wait until at least one signal arrives.
unsigned
char
sig
;
int
nbytes
=
recv
(
r
,
(
char
*
)
&
sig
,
1
,
0
);
win_assert
(
nbytes
!=
-
1
);
return
uint64_t
(
1
)
<<
sig
;
}
}
uint64_t
zmq
::
fd_signaler_t
::
check
()
uint64_t
zmq
::
fd_signaler_t
::
check
()
{
{
unsigned
char
buffer
[
32
];
unsigned
char
buffer
[
32
];
int
nbytes
=
recv
(
r
,
(
char
*
)
buffer
,
32
,
MSG_DONTWAIT
);
int
nbytes
=
recv
(
r
,
(
char
*
)
buffer
,
32
,
0
);
if
(
nbytes
==
-
1
&&
errno
==
EAGAIN
)
if
(
nbytes
==
-
1
&&
WSAGetLastError
()
==
WSAEWOULDBLOCK
)
return
0
;
return
0
;
w
in
_assert
(
nbytes
!=
-
1
);
w
sa
_assert
(
nbytes
!=
-
1
);
uint64_t
signals
=
0
;
uint64_t
signals
=
0
;
for
(
int
pos
=
0
;
pos
!=
nbytes
;
pos
++
)
{
for
(
int
pos
=
0
;
pos
!=
nbytes
;
pos
++
)
{
...
...
src/p2p.cpp
View file @
e6ca5da1
...
@@ -69,16 +69,19 @@ int zmq::p2p_t::xsetsockopt (int option_, const void *optval_,
...
@@ -69,16 +69,19 @@ int zmq::p2p_t::xsetsockopt (int option_, const void *optval_,
int
zmq
::
p2p_t
::
xsend
(
struct
zmq_msg_t
*
msg_
,
int
flags_
)
int
zmq
::
p2p_t
::
xsend
(
struct
zmq_msg_t
*
msg_
,
int
flags_
)
{
{
zmq_assert
(
false
);
zmq_assert
(
false
);
return
0
;
}
}
int
zmq
::
p2p_t
::
xflush
()
int
zmq
::
p2p_t
::
xflush
()
{
{
zmq_assert
(
false
);
zmq_assert
(
false
);
return
0
;
}
}
int
zmq
::
p2p_t
::
xrecv
(
struct
zmq_msg_t
*
msg_
,
int
flags_
)
int
zmq
::
p2p_t
::
xrecv
(
struct
zmq_msg_t
*
msg_
,
int
flags_
)
{
{
zmq_assert
(
false
);
zmq_assert
(
false
);
return
0
;
}
}
src/rep.cpp
View file @
e6ca5da1
...
@@ -155,6 +155,8 @@ int zmq::rep_t::xsend (struct zmq_msg_t *msg_, int flags_)
...
@@ -155,6 +155,8 @@ int zmq::rep_t::xsend (struct zmq_msg_t *msg_, int flags_)
// Detach the message from the data buffer.
// Detach the message from the data buffer.
int
rc
=
zmq_msg_init
(
msg_
);
int
rc
=
zmq_msg_init
(
msg_
);
zmq_assert
(
rc
==
0
);
zmq_assert
(
rc
==
0
);
return
0
;
}
}
int
zmq
::
rep_t
::
xflush
()
int
zmq
::
rep_t
::
xflush
()
...
...
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