Skip to content

Commit f5e742b

Browse files
author
Igor Zinkovsky
committed
upgrade libuv to edbabe6f83
1 parent 9edb984 commit f5e742b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

deps/uv/src/win/udp.c

+21
Original file line numberDiff line numberDiff line change
@@ -578,3 +578,24 @@ void uv_process_udp_send_req(uv_loop_t* loop, uv_udp_t* handle,
578578
DECREASE_PENDING_REQ_COUNT(handle);
579579
}
580580

581+
582+
int uv_udp_set_multicast_ttl(uv_udp_t* handle, int ttl) {
583+
if (setsockopt(handle->socket, IPPROTO_IP, IP_MULTICAST_TTL,
584+
(const char*)&ttl, sizeof ttl) == -1) {
585+
uv__set_sys_error(handle->loop, WSAGetLastError());
586+
return -1;
587+
}
588+
589+
return 0;
590+
}
591+
592+
593+
int uv_udp_set_broadcast(uv_udp_t* handle, int on) {
594+
if (setsockopt(handle->socket, SOL_SOCKET, SO_BROADCAST, (const char*)&on,
595+
sizeof on) == -1) {
596+
uv__set_sys_error(handle->loop, WSAGetLastError());
597+
return -1;
598+
}
599+
600+
return 0;
601+
}

0 commit comments

Comments
 (0)