fix_MSVC
[novacoin.git] / src / stun.cpp
index ee45833..4bf2c94 100644 (file)
 #include <arpa/inet.h>
 #include <netdb.h>
 #endif
+#ifndef WIN32
 #include <unistd.h>
+#endif
 #include <time.h>
 #include <errno.h>
 
-
 #include "ministun.h"
 
 /*---------------------------------------------------------------------*/
@@ -506,8 +507,11 @@ static int StunRequest(const char *host, uint16_t port, struct sockaddr_in *mapp
     int rc = -3;
     if(bind(sock, (struct sockaddr*)&client, sizeof(client)) >= 0)
         rc = StunRequest2(sock, &server, mapped);
-
+#ifndef WIN32
     close(sock);
+#else
+    closesocket(sock);
+#endif
     return rc;
 } // StunRequest