File diff r5974:e11b6f5200f9 → r5975:e1f08be8192a
src/network/core/udp.cpp
Show inline comments
 
@@ -30,21 +30,13 @@ bool NetworkUDPSocketHandler::Listen(con
 
	this->sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
 
	if (!this->IsConnected()) {
 
		DEBUG(net, 0, "[udp] failed to start UDP listener");
 
		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 */
 
	sin.sin_addr.s_addr = host;
 
	sin.sin_port = htons(port);