Skip to content

Commit 4b2490c

Browse files
committed
Update PortUtilities.cs
1 parent d7ff72e commit 4b2490c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dotnet/src/webdriver/Internal/PortUtilities.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ public static class PortUtilities
3232
/// Finds a random, free port to be listened on.
3333
/// </summary>
3434
/// <returns>A random, free port to be listened on.</returns>
35-
/// <exception cref="InvalidOperationException">
36-
/// Thrown when a free port cannot be found due to socket binding issues.
37-
/// </exception>
3835
public static int FindFreePort()
3936
{
4037
var tcpListener = new TcpListener(IPAddress.IPv6Any, 0);
4138

39+
// Enable dual-mode to also work with IPv4 connections
40+
tcpListener.Server.DualMode = true;
41+
4242
try
4343
{
4444
tcpListener.Start();

0 commit comments

Comments
 (0)