upgrade libuv to edbabe6f83
authorIgor Zinkovsky <igorzi@microsoft.com>
Mon, 23 Jan 2012 09:34:05 +0000 (01:34 -0800)
committerIgor Zinkovsky <igorzi@microsoft.com>
Mon, 23 Jan 2012 09:34:05 +0000 (01:34 -0800)
deps/uv/src/win/udp.c

index 0299e77542148b80f2be592cc2b86e1f60d4fcdb..8a36396b473c7027cee1accdfd22cd9adae423cc 100644 (file)
@@ -578,3 +578,24 @@ void uv_process_udp_send_req(uv_loop_t* loop, uv_udp_t* handle,
   DECREASE_PENDING_REQ_COUNT(handle);
 }
 
+
+int uv_udp_set_multicast_ttl(uv_udp_t* handle, int ttl) {
+  if (setsockopt(handle->socket, IPPROTO_IP, IP_MULTICAST_TTL,
+      (const char*)&ttl, sizeof ttl) == -1) {
+    uv__set_sys_error(handle->loop, WSAGetLastError());
+    return -1;
+  }
+
+  return 0;
+}
+
+
+int uv_udp_set_broadcast(uv_udp_t* handle, int on) {
+  if (setsockopt(handle->socket, SOL_SOCKET, SO_BROADCAST, (const char*)&on,
+      sizeof on) == -1) {
+    uv__set_sys_error(handle->loop, WSAGetLastError());
+    return -1;
+  }
+
+  return 0;
+}