Bug 6044 - Socket.SendAsync does not always call a callback on completion
Summary: Socket.SendAsync does not always call a callback on completion
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Martin Baulig
Depends on:
Reported: 2012-07-09 11:29 UTC by Yuriy
Modified: 2016-11-11 10:33 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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 on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Yuriy 2012-07-09 11:29:24 UTC
Sometimes a callback specified in SocketAsyncEventArgs is not called for a Socket.SendAsync operation.  This depends on server load, system configuration etc. (It is very hard to reproduce it on some configurations). 

The problem can be observer on both loopback and real interfaces.  (The sample app  runs on loopback).

The observed behavior is detected by:
- measuring time from SendAsync issues (we look for sockets not reporting completion in 5 seconds) 
- additionally: for sockets with long SendAsync checking the socket status with poll

Sometime it takes just 30 seconds to detect a connection with missing callback and sometimes up to 10-15 minutes.

Here is the sample app that transmits random data in multiple connections between two instances of the app. (See README file)


Also, see this posted in mono-dev list http://lists.ximian.com/pipermail/mono-devel-list/2012-July/039314.html
Comment 1 Martin Baulig 2016-11-11 10:33:27 UTC
Closing ancient bugs, please reopen if you're still having this problem.