mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
(svn r8673) -Codechange: use SetNonBlocking instead of implementing yet another version.
This commit is contained in:
parent
7ee3fc4979
commit
b71d6e1401
@ -153,7 +153,7 @@ typedef unsigned long in_addr_t;
|
|||||||
# endif
|
# endif
|
||||||
#endif // __MORPHOS__ || __AMIGA__
|
#endif // __MORPHOS__ || __AMIGA__
|
||||||
|
|
||||||
static inline bool SetNonBlocking(const int d)
|
static inline bool SetNonBlocking(SOCKET d)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
u_long nonblocking = 1;
|
u_long nonblocking = 1;
|
||||||
@ -167,7 +167,7 @@ static inline bool SetNonBlocking(const int d)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool SetNoDelay(const int d)
|
static inline bool SetNoDelay(SOCKET d)
|
||||||
{
|
{
|
||||||
/* XXX should this be done at all? */
|
/* XXX should this be done at all? */
|
||||||
#if !defined(BEOS_NET_SERVER) // not implemented on BeOS net_server
|
#if !defined(BEOS_NET_SERVER) // not implemented on BeOS net_server
|
||||||
|
@ -33,15 +33,7 @@ bool NetworkUDPSocketHandler::Listen(const uint32 host, const uint16 port, const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set nonblocking mode for socket */
|
SetNonBlocking(this->sock);
|
||||||
{
|
|
||||||
unsigned long blocking = 1;
|
|
||||||
#ifndef BEOS_NET_SERVER
|
|
||||||
ioctlsocket(this->sock, FIONBIO, &blocking);
|
|
||||||
#else
|
|
||||||
setsockopt(this->sock, SOL_SOCKET, SO_NONBLOCK, &blocking, NULL);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
sin.sin_family = AF_INET;
|
sin.sin_family = AF_INET;
|
||||||
/* Listen on all IPs */
|
/* Listen on all IPs */
|
||||||
|
Loading…
Reference in New Issue
Block a user