#endif
#if defined (_WIN32)
+
+ /* Check windows version so we know if we need to increase receive buffers
+ * for Windows 7 and earlier
+
+ * SetSocketMediaStreamingMode is present in win 8 and later, so we set
+ * receive buffer if that isn't present
+ */
+ HINSTANCE h_Network = LoadLibraryW(L"Windows.Networking.dll");
+ if( (h_Network == NULL) ||
+ (GetProcAddress( h_Network, "SetSocketMediaStreamingMode" ) == NULL ) )
+ {
+ setsockopt (fd, SOL_SOCKET, SO_RCVBUF,
+ (void *)&(int){ 0x80000 }, sizeof (int));
+ }
+ if( h_Network )
+ FreeLibrary( h_Network );
+
if (net_SockAddrIsMulticast (ptr->ai_addr, ptr->ai_addrlen)
&& (sizeof (struct sockaddr_storage) >= ptr->ai_addrlen))
{