Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

No close application after of get exception of try catch

$
0
0

Hello guys.

i have a socket connection using try and catch, but after of show error message with catch my application is close automatically.

My code:

try
{
sockets = await Task.Run(() => sockets = new Socket("IP", PORT));
}
catch (SocketException ex)
{
Device.BeginInvokeOnMainThread(async() =>
{
await dialogservice.ShowMessage("Error", "Error in download: " + ex.Message + "In" +
": " + ex.Source + "or too: " + ex.LocalizedMessage);
});

        }

``
I need that my application dont close after of show message by catch. ¿Who know how can solve this?.


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>