summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/network/core/os_abstraction.h4
-rw-r--r--src/network/core/udp.cpp10
2 files changed, 3 insertions, 11 deletions
diff --git a/src/network/core/os_abstraction.h b/src/network/core/os_abstraction.h
index c4cbcee20..00545c70f 100644
--- a/src/network/core/os_abstraction.h
+++ b/src/network/core/os_abstraction.h
@@ -153,7 +153,7 @@ typedef unsigned long in_addr_t;
# endif
#endif // __MORPHOS__ || __AMIGA__
-static inline bool SetNonBlocking(const int d)
+static inline bool SetNonBlocking(SOCKET d)
{
#ifdef WIN32
u_long nonblocking = 1;
@@ -167,7 +167,7 @@ static inline bool SetNonBlocking(const int d)
#endif
}
-static inline bool SetNoDelay(const int d)
+static inline bool SetNoDelay(SOCKET d)
{
/* XXX should this be done at all? */
#if !defined(BEOS_NET_SERVER) // not implemented on BeOS net_server
diff --git a/src/network/core/udp.cpp b/src/network/core/udp.cpp
index cc83577ef..45ed287c1 100644
--- a/src/network/core/udp.cpp
+++ b/src/network/core/udp.cpp
@@ -33,15 +33,7 @@ bool NetworkUDPSocketHandler::Listen(const uint32 host, const uint16 port, const
return false;
}
- /* set nonblocking mode for socket */
- {
- unsigned long blocking = 1;
-#ifndef BEOS_NET_SERVER
- ioctlsocket(this->sock, FIONBIO, &blocking);
-#else
- setsockopt(this->sock, SOL_SOCKET, SO_NONBLOCK, &blocking, NULL);
-#endif
- }
+ SetNonBlocking(this->sock);
sin.sin_family = AF_INET;
/* Listen on all IPs */