I am sorry if i do/did something wrong here, this is my first question in this website.
I am trying to completly exit my application (process) when a BeginConnect throws an error (mainly SocketException).
My code right now :
try
{
Socket.BeginConnect(new IPEndPoint(IPAddress.Parse(ip), port), new AsyncCallback(ConnectionCallBack), Socket);
}
catch (System.Exception ex)
{
OnError(new ErrorEventArgs(ex));
}
The ErrorEvent fires, and this is where i try to exit my application :
if (e.Ex is SocketException)
{
MessageBox.Show(LanguageManager.GetText("Erreur1"));
client.Dispose();
Application.Exit();
}
But then, the debug mode is still running.. or if i try it without the debug mode, i find the process still there in the task manager.
Thanks for helping !