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
58059939
Commit
58059939
authored
Feb 07, 2016
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: compile warnings on Windows in new radio/dish code
Solution: fix these.
parent
e0f02bdf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
26 deletions
+22
-26
dish.cpp
src/dish.cpp
+1
-1
radio.cpp
src/radio.cpp
+3
-3
udp_address.hpp
src/udp_address.hpp
+0
-2
udp_engine.cpp
src/udp_engine.cpp
+18
-20
No files found.
src/dish.cpp
View file @
58059939
...
...
@@ -325,7 +325,7 @@ int zmq::dish_session_t::pull_msg (msg_t *msg_)
if
(
!
msg_
->
is_join
()
&&
!
msg_
->
is_leave
())
return
rc
;
else
{
int
group_length
=
strlen
(
msg_
->
group
());
int
group_length
=
(
int
)
strlen
(
msg_
->
group
());
msg_t
command
;
int
offset
;
...
...
src/radio.cpp
View file @
58059939
...
...
@@ -184,12 +184,12 @@ int zmq::radio_session_t::push_msg (msg_t *msg_)
// Set the msg type to either JOIN or LEAVE
if
(
data_size
>=
5
&&
memcmp
(
command_data
,
"
\4
JOIN"
,
5
)
==
0
)
{
group_length
=
data_size
-
5
;
group_length
=
(
int
)
data_size
-
5
;
group
=
command_data
+
5
;
rc
=
join_leave_msg
.
init_join
();
}
else
if
(
data_size
>=
6
&&
memcmp
(
command_data
,
"
\5
LEAVE"
,
6
)
==
0
)
{
group_length
=
data_size
-
6
;
group_length
=
(
int
)
data_size
-
6
;
group
=
command_data
+
6
;
rc
=
join_leave_msg
.
init_leave
();
}
...
...
@@ -223,7 +223,7 @@ int zmq::radio_session_t::pull_msg (msg_t *msg_)
return
rc
;
const
char
*
group
=
pending_msg
.
group
();
int
length
=
strlen
(
group
);
int
length
=
(
int
)
strlen
(
group
);
// First frame is the group
msg_
->
init_size
(
length
);
...
...
src/udp_address.hpp
View file @
58059939
...
...
@@ -41,7 +41,6 @@
namespace
zmq
{
class
udp_address_t
{
public
:
...
...
@@ -71,7 +70,6 @@ namespace zmq
const
in_addr
interface_ip
()
const
;
private
:
in_addr
multicast
;
in_addr
iface
;
sockaddr_in
bind_address
;
...
...
src/udp_engine.cpp
View file @
58059939
...
...
@@ -38,7 +38,7 @@ zmq::udp_engine_t::~udp_engine_t()
}
}
int
zmq
::
udp_engine_t
::
init
(
address_t
*
address_
,
bool
send_
,
bool
recv_
)
int
zmq
::
udp_engine_t
::
init
(
address_t
*
address_
,
bool
send_
,
bool
recv_
)
{
zmq_assert
(
address_
);
zmq_assert
(
send_
||
recv_
);
...
...
@@ -74,33 +74,31 @@ void zmq::udp_engine_t::plug (io_thread_t* io_thread_, session_base_t *session_)
if
(
recv_enabled
)
{
int
on
=
1
;
int
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
(
char
*
)
&
on
,
sizeof
(
on
));
#ifdef ZMQ_HAVE_WINDOWS
wsa_assert
(
rc
!=
SOCKET_ERROR
);
#else
errno_assert
(
rc
==
0
);
#endif
rc
=
bind
(
fd
,
address
->
resolved
.
udp_addr
->
bind_addr
(),
address
->
resolved
.
udp_addr
->
bind_addrlen
());
#ifdef ZMQ_HAVE_WINDOWS
wsa_assert
(
rc
!=
SOCKET_ERROR
);
#else
errno_assert
(
rc
==
0
);
#endif
#ifdef ZMQ_HAVE_WINDOWS
wsa_assert
(
rc
!=
SOCKET_ERROR
);
#else
errno_assert
(
rc
==
0
);
#endif
rc
=
bind
(
fd
,
address
->
resolved
.
udp_addr
->
bind_addr
(),
address
->
resolved
.
udp_addr
->
bind_addrlen
());
#ifdef ZMQ_HAVE_WINDOWS
wsa_assert
(
rc
!=
SOCKET_ERROR
);
#else
errno_assert
(
rc
==
0
);
#endif
if
(
address
->
resolved
.
udp_addr
->
is_mcast
())
{
struct
ip_mreq
mreq
;
mreq
.
imr_multiaddr
=
address
->
resolved
.
udp_addr
->
multicast_ip
();
mreq
.
imr_interface
=
address
->
resolved
.
udp_addr
->
interface_ip
();
int
rc
=
setsockopt
(
fd
,
IPPROTO_IP
,
IP_ADD_MEMBERSHIP
,
(
char
*
)
&
mreq
,
sizeof
(
mreq
));
#ifdef ZMQ_HAVE_WINDOWS
wsa_assert
(
rc
!=
SOCKET_ERROR
);
#else
errno_assert
(
rc
==
0
);
#endif
}
set_pollin
(
handle
);
// Call restart output to drop all join/leave commands
...
...
@@ -147,10 +145,10 @@ void zmq::udp_engine_t::out_event()
errno_assert
(
rc
==
0
);
#ifdef ZMQ_HAVE_WINDOWS
rc
=
sendto
(
fd
,
(
char
*
)
out_buffer
,
size
,
0
,
address
->
resolved
.
udp_addr
->
dest_addr
(),
address
->
resolved
.
udp_addr
->
dest_addrlen
());
wsa_assert
(
rc
!=
SOCKET_ERROR
);
rc
=
sendto
(
fd
,
(
const
char
*
)
out_buffer
,
(
int
)
size
,
0
,
address
->
resolved
.
udp_addr
->
dest_addr
(),
(
int
)
address
->
resolved
.
udp_addr
->
dest_addrlen
());
wsa_assert
(
rc
!=
SOCKET_ERROR
);
#else
rc
=
sendto
(
fd
,
out_buffer
,
size
,
0
,
address
->
resolved
.
udp_addr
->
dest_addr
(),
...
...
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