[Mono-bugs] [Bug 638098] New: Socket.Connect() should allow IPAddress.Any from datagram sockets

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Sep 9 01:08:47 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=638098

https://bugzilla.novell.com/show_bug.cgi?id=638098#c0


           Summary: Socket.Connect() should allow IPAddress.Any from
                    datagram sockets
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jeroen at sumatra.nl
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64;
Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729;
Media Center PC 6.0; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E; InfoPath.3)

A datagram socket can be "connected" with Socket.Connect(), but it can also be
disconnected again, by doing Socket.Connect(...IPAddress.Any..) (or
IPAddress.IPv6Any). Mono doesn't support the disconnect. The code to repro is:

using System;
using System.Net;
using System.Net.Sockets;

class Test {
  static void Main() {
    Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram,
ProtocolType.Udp);
    s.Bind(new IPEndPoint(IPAddress.Any, 0));
    s.Connect(new IPEndPoint(IPAddress.Loopback, 1234));
    s.Connect(new IPEndPoint(IPAddress.Any, 0));
  }
}


Reproducible: Always

Steps to Reproduce:
compile & run
Actual Results:  
Unhandled Exception: System.Net.Sockets.SocketException: The requested address
is not valid in its context.

  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000]
in <filename unknown>:0
  at Test.Main () [0x00000] in <filename unknown>:0

Expected Results:  
The socket should go back to its initial unconnected state.

-- 
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