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 successfully send data over a network stream after connecting the socket to a specified IP address. However, when turning off the WiFi (after having established the connection), the network stream sends data over the socket without any indication that the connection has been severed. Normally, an exception is thrown under such circumstances.
Steps to Reproduce:
With the WiFi connection on, setup a network stream with a socket that is connected to a host on an ip address that is listening on the specified port. Sending data using the Stream's BeginWrite() method should work at this point.
Now turn off the wireless connection (without closing the socket and creating a new socket) and try sending data using Stream's BeginWrite().
No error occurs, and the callback specified in BeginWrite() is immediately called, even though, due to the lack of a physical connection, no data was actually sent.
An IO Exception should have been thrown since the data technically was not sent.
This is how it works when the code was tested on a Windows device.
Platform is Android 2.3 on an LG Optimus3d
The difference is in the way the underlying operating system handles the connection, it is likely that Android does not shit down the interface and keeps the socket alive until TCP/IP gets a timeout.