Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 42617 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
count should be 1, but actually it's 2. When ConnectAsync returns false, Completed is not meant to be called.
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
SocketAsyncEventArgs e = new SocketAsyncEventArgs();
int count = 0;
e.RemoteEndPoint = new IPEndPoint(IPAddress.Any, 9999);
e.Completed += (sender, args) => Interlocked.Increment(ref count);
Debug.Assert(count == 1);
Could you provide a test case that demonstrate your issue?
A code snippet is not enough to fully understand what you're trying to do.
You want me to copy paste that code into a project for you? No thanks.
The problem is clear, if ConnectAsync returns false, it should not fire SocketAsyncEventArgs.Completed.
We've already worked around the problem.
Created attachment 16862 [details]
Add a sample console project with the code from the report.
I ran it and count is 1, so I am not sure if I am using the correct mono version or if the test case is bad.
Mono 4.4.0 (mono-4.4.0-branch/fcf7a6d) (64-bit)
I ran the test on an iPhone, so it is possible that the network stack behaves differently when trying to connect to IPAddress.Any.
Created attachment 16875 [details]
Attached a new sample project that includes an iOS app project with the same code.
Both projects (console and iOS) reproduce the issue when using IPAddress.Any. The count is 2, and the expected is 1.
=== Xamarin Studio Enterprise ===
Version 6.0.2 (build 73)
Installation UUID: e01c3049-a2d2-4e0a-aad8-afe6fb627c4d
Mono 4.4.2 (mono-4.4.0-branch-c7sr1/f72fe45) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Package version: 404020011
=== Xamarin.Profiler ===
=== Apple Developer Tools ===
Xcode 7.3 (10183.3)
=== Xamarin.Mac ===
Version: 188.8.131.52 (Xamarin Enterprise)
=== Xamarin.Android ===
Version: 184.108.40.206 (Xamarin Enterprise)
Android SDK: /Users/johnmiller/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.4 (API level 19)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
SDK Tools Version: 25.1.7
SDK Platform Tools Version: 24.0.0
SDK Build Tools Version: 23.0.2
Java SDK: /usr
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
Android Designer EPL code available here:
=== Xamarin Android Player ===
Location: /Applications/Xamarin Android Player.app
=== Xamarin.iOS ===
Version: 220.127.116.11 (Xamarin Enterprise)
Build date: 2016-07-28 12:17:02-0400
=== Xamarin Inspector ===
Build date: Mon Jun 13 19:14:13 UTC 2016
=== Build Information ===
Release ID: 600020073
Git revision: a6f7a24a9723a2d4f5d33c176615b0d44703ab5b
Build date: 2016-07-26 13:36:15-04
Xamarin addins: f5acb37866a0141bc5ddbe95118f18dae4014568
Build lane: monodevelop-lion-cycle7-sr1
=== Operating System ===
Mac OS X 10.11.2
=== Enabled user installed addins ===
Prism Template Pack 1.3
Xamarin Inspector 0.9.0.14