|
|
@@ -66,13 +66,21 @@ HV_INLINE int nonblocking(int sockfd) {
|
|
|
|
|
|
typedef int hsocket_t;
|
|
|
|
|
|
-#define blocking(s) fcntl(s, F_SETFL, fcntl(s, F_GETFL) & ~O_NONBLOCK)
|
|
|
-#define nonblocking(s) fcntl(s, F_SETFL, fcntl(s, F_GETFL) | O_NONBLOCK)
|
|
|
-
|
|
|
#ifndef SOCKET
|
|
|
#define SOCKET int
|
|
|
#endif
|
|
|
+
|
|
|
+#ifndef INVALID_SOCKET
|
|
|
#define INVALID_SOCKET -1
|
|
|
+#endif
|
|
|
+
|
|
|
+HV_INLINE int blocking(int s) {
|
|
|
+ return fcntl(s, F_SETFL, fcntl(s, F_GETFL) & ~O_NONBLOCK);
|
|
|
+}
|
|
|
+
|
|
|
+HV_INLINE int nonblocking(int s) {
|
|
|
+ return fcntl(s, F_SETFL, fcntl(s, F_GETFL) | O_NONBLOCK);
|
|
|
+}
|
|
|
|
|
|
HV_INLINE int closesocket(int sockfd) {
|
|
|
return close(sockfd);
|