[Mono-bugs] [Bug 77020][Wis] New - BeginConnect is still broken on
OS X, just in a more interesting way
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Fri Dec 16 22:20:28 EST 2005
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 bryan at imeem.com.
http://bugzilla.ximian.com/show_bug.cgi?id=77020
--- shadow/77020 2005-12-16 22:20:28.000000000 -0500
+++ shadow/77020.tmp.4758 2005-12-16 22:20:28.000000000 -0500
@@ -0,0 +1,113 @@
+Bug#: 77020
+Product: Mono: Runtime
+Version: 1.1
+OS: Mac OS X 10.3
+OS Details: Mac OS X 10.4, ppc
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: io-layer
+AssignedTo: dick at ximian.com
+ReportedBy: bryan at imeem.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: BeginConnect is still broken on OS X, just in a more interesting way
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+This is an extension of #75436. If you make an asynchronous connection and
+it fails, then you attempt to make another asynchronous connection, the
+asynchronous callback is never called. I'm using 1.1.11 (the dmg Miguel
+posted to primates) This bug is specific to OS X. The code below works on
+Linux (x86, 1.1.11).
+
+Steps to reproduce the problem:
+1. Test case:
+
+using System;
+using System.Net;
+using System.Net.Sockets;
+using System.Threading;
+
+ public class Test
+ {
+ public static void Main(string[] args)
+ {
+ IPHostEntry hostAddress = Dns.GetHostByName("counterpop.net");
+ foreach(IPAddress addr in hostAddress.AddressList) {
+ System.Console.WriteLine("ip address: " +
+addr.ToString());
+
+ Socket blargle = new
+Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+ IPEndPoint endPoint = new IPEndPoint(addr, 80);
+ blargle.BeginConnect(endPoint, new
+AsyncCallback(ConnectSocketCallback), blargle) ;
+
+ System.Console.WriteLine("Sleeping for a bit.");
+
+ Thread.Sleep(1000);
+
+ System.Console.WriteLine("oh, hi there.");
+
+ Socket blargl0r = new
+Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+ IPEndPoint otherEndPoint = new IPEndPoint(addr, 80);
+ System.Console.WriteLine("blah");
+ blargl0r.BeginConnect(otherEndPoint, new
+AsyncCallback(ConnectSocketCallback), blargl0r) ;
+
+ System.Console.WriteLine("Sleeping for a bit.");
+
+ Thread.Sleep(10000);
+ }
+ }
+
+ public static void ConnectSocketCallback (IAsyncResult iar) {
+ System.Console.WriteLine("socket callback: " + iar);
+ Socket sock = (Socket)iar.AsyncState;
+ try
+ {
+ sock.EndConnect(iar);
+ }
+ catch (Exception e)
+ {
+ System.Console.WriteLine("got exception: {0}",
+e.ToString());
+ }
+ }
+}
+
+Actual Results:
+
+On Mac OS X (10.4.3, ppc):
+
+bryan at zoidberg:~/Desktop/blargle$ mono socket.exe
+ip address: 216.129.104.218
+Sleeping for a bit.
+socket callback: System.Net.Sockets.Socket+SocketAsyncResult
+oh, hi there.
+blah
+
+(Does not return to command line.)
+
+Expected Results:
+
+On Linux (1.1.11, x86):
+
+bryan at hesh:~$ mono socket.exe
+ip address: 216.129.104.218
+Sleeping for a bit.
+socket callback: System.Net.Sockets.Socket+SocketAsyncResult
+oh, hi there.
+blah
+Sleeping for a bit.
+socket callback: System.Net.Sockets.Socket+SocketAsyncResult
+
+How often does this happen?
+
+Every time.
More information about the mono-bugs
mailing list