src/network/core/udp.cpp
changeset 7366 f2c2c5515649
parent 6121 2aae24b0881f
child 7922 a7e266f966d9
equal deleted inserted replaced
7365:32d244531e1a 7366:f2c2c5515649
   108 
   108 
   109 	packet_len = sizeof(p.buffer);
   109 	packet_len = sizeof(p.buffer);
   110 	client_len = sizeof(client_addr);
   110 	client_len = sizeof(client_addr);
   111 
   111 
   112 	/* Try to receive anything */
   112 	/* Try to receive anything */
       
   113 	SetNonBlocking(this->sock); // Some OSes seem to loose the non-blocking status of the socket
   113 	nbytes = recvfrom(this->sock, (char*)p.buffer, packet_len, 0, (struct sockaddr *)&client_addr, &client_len);
   114 	nbytes = recvfrom(this->sock, (char*)p.buffer, packet_len, 0, (struct sockaddr *)&client_addr, &client_len);
   114 
   115 
   115 	/* We got some bytes for the base header of the packet. */
   116 	/* We got some bytes for the base header of the packet. */
   116 	if (nbytes > 2) {
   117 	if (nbytes > 2) {
   117 		p.PrepareToRead();
   118 		p.PrepareToRead();