Zebediah Figura (@zfigura) commented about dlls/ws2_32/tests/sock.c:
ok ( n_recv == sizeof(buf), "UDP: recvfrom() received wrong amount of data or socket error: %d\n", n_recv ); ok ( memcmp ( &peer[0].peer.sin_port, buf, sizeof(peer[0].addr.sin_port) ) == 0, "UDP: port numbers do not match\n" ); }
- sock = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP);
- ok( sock != INVALID_SOCKET, "got error %u.\n", WSAGetLastError() );
- memset( &addr, 0, sizeof(addr) );
- addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = inet_addr("127.0.0.1");
- addr.sin_port = htons(23456);
This is a bit risky since the port might be in use. Elsewhere we use the guaranteed-invalid port number 255.