Bug 16855 - ServerSentEvent stream does not detect network is down
Summary: ServerSentEvent stream does not detect network is down
Status: CONFIRMED
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler (show other bugs)
Version: 4.12.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2013-12-17 13:51 UTC by Gustavo Armenta
Modified: 2013-12-23 03:11 UTC (History)
2 users (show)

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


Attachments
Stream hanging sample (5.35 MB, application/x-zip-compressed)
2013-12-20 17:06 UTC, Gustavo Armenta
Details


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 for Bug 16855 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 original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Gustavo Armenta 2013-12-17 13:51:39 UTC
This bug is similar to bug 16849

Start a http(s) request on Xamarin Android or iOS and the server side never
returns headers response initiating a Server Sent Events connection. Disconnect network cable, or on a physical device change to Airplane Mode. The standing stream.ReadAsync does not fail, it hangs.

REPRO
Open attached solution
Run sample in an Android API 15 emulator
Let the sample run for 1 minute, notice there is a stream.readAsync completing every 10 seconds
Disconnect network cable, notice the application does not detect the failure, stream.readAsync just hangs
Comment 1 Sadik Ali 2013-12-19 08:21:17 UTC
Please attach the sample project
Comment 2 Jonathan Pryor 2013-12-20 15:48:31 UTC
Just as with https://bugzilla.xamarin.com/show_bug.cgi?id=16849#c1 network disconnects are notoriously difficult.

That said, are you enabling IOControlCode.KeepAliveValues?

http://stackoverflow.com/a/4667582/83444
Comment 3 Gustavo Armenta 2013-12-20 17:06:50 UTC
Created attachment 5709 [details]
Stream hanging sample
Comment 4 Sadik Ali 2013-12-23 03:10:18 UTC
I have verified this issue and reproduced at my end, following are the steps:

1. Download attached project.
2. Debug on API 15 and noticed a stream.readAsync printing in every 10 seconds
3. After 1 minute I unplugged internet connection.
4. stream.readAsync logging on app is stoped and no message displayed.
5. I connected internet again  and observed that stream.readAsync printed "Done" on application

Refer attached screenshot: http://screencast.com/t/1u2V1AjR

Checked With:

Win 7
XS 4.2.2 (build 2)
X.A. 4.10.1-68
API 15 emulator