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 39888 on
Developer Community or GitHub 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
Created attachment 15517 [details]
Simple project containing the bug
I made an app which needs to scan networks for specific hosts. More precisely I want to create a list of all hosts with whom the connection was successfully established on a specific port.
e.g. find all reachable hosts from 192.168.0.1 to 192.168.0.255 on port 80
The standard timeout for a connect operation is roughly 2 minutes and definitely too high for my purpose. Therefore I had to find a way to set a timeout. The only intended way to do this is by using the static CancelConnectAsync method of the Socket class. See https://msdn.microsoft.com/library/system.net.sockets.socket.cancelconnectasync(v=vs.110).aspx
Xamarin Android however does not support this method. My workaround for this is to forcefully stop the ongoing connect by closing the socket. So far it worked really well. On Android Marshmallow however the app crashes after doing so by no later than 255 times.
I attached a simple test case and created a video of it here:
The log can be found here:
This is probably the most important line.
03-24 10:17:54.031: A/art(1604): art/runtime/fault_handler.cc:117] Check failed: !initialized_