[Mono-bugs] [Bug 52329][Nor] New - TcpListener with port=0 does not bind to free port

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 12 Jan 2004 03:10:06 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by gonzalo@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=52329

--- shadow/52329	2004-01-12 03:10:06.000000000 -0500
+++ shadow/52329.tmp.20698	2004-01-12 03:10:06.000000000 -0500
@@ -0,0 +1,50 @@
+Bug#: 52329
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: 
+Status: RESOLVED   
+Resolution: FIXED
+Severity: Unknown
+Priority: Normal
+Component: Mono.POSIX
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: lluis@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: TcpListener with port=0 does not bind to free port
+
+Description of Problem:
+When constructing a TcpListener with port=0, it should assign an available
+free port, but it does not. I think this used to work.
+
+Steps to reproduce the problem:
+Run this:
+
+using System;
+using System.Net;
+using System.Net.Sockets;
+
+public class Test
+{
+	static void Main ()
+	{
+		TcpListener listener = new TcpListener (IPAddress.Any, 0);
+		listener.Start ();
+		Console.WriteLine (((IPEndPoint)listener.LocalEndpoint).Port);
+	}
+}
+
+Actual Results:
+It prints "0"
+
+Expected Results:
+It should print a valid free port.
+
+------- Additional Comments From gonzalo@ximian.com  2003-12-17 21:53 -------
+Fixed in CVS.
+
+------- Additional Comments From gonzalo@ximian.com  2004-01-12 03:10 -------
+*** Bug 52759 has been marked as a duplicate of this bug. ***