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 on
Developer Community or GitHub 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.
I am using ASMX services to get data from the server, On the go if i switch the connection
from Wifi to a cellular data connection or cellular data to Wifi my app losses the connectivity to web service and again i have to kill the app. Again it is working fine.
Can you please suggest what i have to do when switching from Wifi to a cellular data connection or cellular data to Wifi.
Any updates on this item, Thanks
Can you try adding the following code as the first line the the Main method, and see if something changes:
System.Net.ServicePointManager.MaxServicePointIdleTime = 1;
Environment.SetEnvironmentVariable ("MONO_TLS_SESSION_CACHE_TIMEOUT", "0");
Not able to add Environment.SetEnvironmentVariable ("MONO_TLS_SESSION_CACHE_TIMEOUT", "0"); through Code.
Added via project=>options=>Run=>GeneralEnvironmentVariable
But still i am having issue while switching from WIFI to 3G
Why were you not able to set MONO_TLS_SESSION_CACHE_TIMEOUT through code?
Did you set MaxServicePointIdleTime to 1 as well?
I added System.Net.ServicePointManager.MaxServicePointIdleTime = 1; as my firs line inside the main method of Main.CS
But Environment.SetEnvironmentVariable shows method not available only getEnvironmentVariable variable is available.
Martin, do you have an iOS device with a sim card? If so, could you have a look at this?
Created attachment 7442 [details]
Error While adding environment Variable
Error While adding environment Variable..
Just want to set things straight here.
When you switch from a radio connection to a WiFi connection you are changing your IP address, and when that happens, existing TCP connections are reset.
So this is entirely expected: switching networks will reset TCP connections, and by extension, it will reset HTTP connections.
The workaround is to detect whenever this connection closes, and re-establish the connection.
The original report does not really describe what "loses connectivity" is
iOS 7 is able to support the transition in certain networks that support TCP multipath:
The sample we created and provided to your team, they were also able to replicate the issue with that and then it was posted for further analysis to the iOS team.
I would appreciate, if you can review that sample and test the scenario I posted below and provide us guidance.
The issue we are facing is, if we were outside and start using the application in 3G and come inside a wifi network, it continue to work.
if the application is started with wifi connection and when we go out on to 3G connection - it stops working. In this case we close and restart it is not working.
Even if we close the webservice object and create a new webservice object it is not working.
is there anything we need to do extra.
previously programmer from xamarin, suggested to set some environment variables, but that we are not able to even compile because SET is not allowed on those (we got compilation error).
Same issue with android also.
if needed we can send you the test application and the screenshot of errors again.
I am getting the following exception and Crash when i used the
System.Net.ServicePointManager.MaxServicePointIdleTime = 1; as the first line of the main method.
0 ActiveResponse 0x00b6149d mono_handle_exception_internal + 2484
1 ActiveResponse 0x00b60ae3 mono_handle_exception + 10
2 ActiveResponse 0x00b5b2d5 mono_arm_throw_exception + 104
3 ActiveResponse 0x00352c64 throw_exception + 68
at System.Net.ServicePoint.CheckAvailableForRecycling (System.DateTime&) [0x0010b] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/ServicePoint.cs:317
at System.Net.ServicePoint.IdleTimerCallback (object) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/ServicePoint.cs:338
at System.Threading.Timer/Scheduler.TimerCB (object) [0x00007] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading/Timer.cs:317
at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0x000c8>
8 ActiveResponse 0x00b6d101 mono_jit_runtime_invoke + 1196
9 ActiveResponse 0x00bac0e5 mono_runtime_invoke + 88
10 ActiveResponse 0x00baf88b mono_runtime_delegate_invoke + 62
11 ActiveResponse 0x00bdafbb async_invoke_thread + 1954
12 ActiveResponse 0x00be0df5 start_wrapper + 244
13 ActiveResponse 0x00bf34d3 inner_start_thread + 158
14 libsystem_pthread.dylib 0x397a5919 <redacted> + 140
15 libsystem_pthread.dylib 0x397a588b _pthread_start + 102
16 libsystem_pthread.dylib 0x397a3aa4 thread_start + 8
What happens if you put the device into aircraft mode and turn the 3G back on after about three minutes? If that fixes it, then what happens if you activate and immediately deactivate aircraft mode?
Can you also try to simply connect to the web service even if that NetworkStatus check returns false.
The crash from comment #14 looks like a bug that's already been fixed.
Reviewing this article https://bugzilla.xamarin.com/show_bug.cgi?id=15152 and correlating the same with our project , we came to know,because of this server ip switching, our application is losing
connectivity and never able to connect to host and not working.
i.e. DNS not refreshing.
So it not an issue and we resolve it for our server side.
Thanks for your kind help.
we can close this bug.