mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-31 01:43:02 +08:00
Merge pull request #2209 from saifhhasan/master
Make ZMQ_TOS work with IPv6 sockets
This commit is contained in:
commit
bc1860430a
13
src/ip.cpp
13
src/ip.cpp
@ -167,6 +167,19 @@ void zmq::set_ip_type_of_service (fd_t s_, int iptos)
|
||||
{
|
||||
int rc = setsockopt(s_, IPPROTO_IP, IP_TOS, reinterpret_cast<const char*>(&iptos), sizeof(iptos));
|
||||
|
||||
#ifdef ZMQ_HAVE_WINDOWS
|
||||
wsa_assert (rc != SOCKET_ERROR);
|
||||
#else
|
||||
errno_assert (rc == 0);
|
||||
#endif
|
||||
|
||||
rc = setsockopt(
|
||||
s_,
|
||||
IPPROTO_IPV6,
|
||||
IPV6_TCLASS,
|
||||
reinterpret_cast<const char*>(&iptos),
|
||||
sizeof(iptos));
|
||||
|
||||
#ifdef ZMQ_HAVE_WINDOWS
|
||||
wsa_assert (rc != SOCKET_ERROR);
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user