Let the kernel pick a random port
Avoid errors if the socket enters the TIME_WAIT state and we need to re-execute this test before the OS releases it. This problem was not really a problem before since the accept()-ed socket was never closed on the server-side.
This commit is contained in:
@@ -145,7 +145,7 @@ test "listen on a port, send bytes, receive bytes" {
|
||||
|
||||
// Try only the IPv4 variant as some CI builders have no IPv6 localhost
|
||||
// configured.
|
||||
const localhost = try net.Address.parseIp("127.0.0.1", 8080);
|
||||
const localhost = try net.Address.parseIp("127.0.0.1", 0);
|
||||
|
||||
var server = net.StreamServer.init(.{});
|
||||
defer server.deinit();
|
||||
|
||||
Reference in New Issue
Block a user