src/network/core/udp.cpp
changeset 5975 af5c8ffc42e3
parent 5918 f06b73812d5f
child 6121 2aae24b0881f
equal deleted inserted replaced
5974:5daa58eb1e0a 5975:af5c8ffc42e3
    31 	if (!this->IsConnected()) {
    31 	if (!this->IsConnected()) {
    32 		DEBUG(net, 0, "[udp] failed to start UDP listener");
    32 		DEBUG(net, 0, "[udp] failed to start UDP listener");
    33 		return false;
    33 		return false;
    34 	}
    34 	}
    35 
    35 
    36 	/* set nonblocking mode for socket */
    36 	SetNonBlocking(this->sock);
    37 	{
       
    38 		unsigned long blocking = 1;
       
    39 #ifndef BEOS_NET_SERVER
       
    40 		ioctlsocket(this->sock, FIONBIO, &blocking);
       
    41 #else
       
    42 		setsockopt(this->sock, SOL_SOCKET, SO_NONBLOCK, &blocking, NULL);
       
    43 #endif
       
    44 	}
       
    45 
    37 
    46 	sin.sin_family = AF_INET;
    38 	sin.sin_family = AF_INET;
    47 	/* Listen on all IPs */
    39 	/* Listen on all IPs */
    48 	sin.sin_addr.s_addr = host;
    40 	sin.sin_addr.s_addr = host;
    49 	sin.sin_port = htons(port);
    41 	sin.sin_port = htons(port);