[Mono-bugs] [Bug 471580] New: Socket ReuseAddress doesn't seem to work for UDP sockets on Mac OS X

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Feb 2 12:01:48 EST 2009


           Summary: Socket ReuseAddress doesn't seem to work for UDP
                    sockets on Mac OS X
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.2.x
          Platform: Other
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: benoit at zeroc.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

Description of Problem:

Binding 2 different datagram sockets to the same IP/port fails on Mac OS X,
works on Linux & Windows.

Steps to reproduce the problem:
1. Run the test case below

Actual Results:
macbookpro:~/Devel$ mono ./test.exe
System.Net.Sockets.SocketException: Address already in use
  at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00000] 
  at Client.Main (System.String[] args) [0x00000] 

Expected Results:

How often does this happen? 

Additional Information:

Here's the test case:

    public static void Main(string[] args)
            Socket socket = new Socket(AddressFamily.InterNetwork,
SocketType.Dgram, ProtocolType.Udp);
SocketOptionName.ReuseAddress, 1);
            socket.Bind(new IPEndPoint(IPAddress.Any, 12345));

            Socket socket2 = new Socket(AddressFamily.InterNetwork,
SocketType.Dgram, ProtocolType.Udp);
SocketOptionName.ReuseAddress, 1);
            socket2.Bind(new IPEndPoint(IPAddress.Any, 12345));
        catch(SocketException ex)

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list