public void CloseAbortively() { try { ClientSocket.AbortiveClose(); ClientSocket = null; ClientSocketState = SocketState.Closed; Console.WriteLine("Abortively closed socket"); } catch (Exception ex) { ResetSocket(); Console.WriteLine("Error aborting socket: [" + ex.GetType().Name + "] " + ex.Message); } finally { RefreshDisplay(); } }
private void buttonAbortiveClose_Click(object sender, EventArgs e) { try { ClientSocket.AbortiveClose(); ClientSocket = null; ClientSocketState = SocketState.Closed; textBoxLog.AppendText("Abortively closed socket" + Environment.NewLine); } catch (Exception ex) { ResetSocket(); textBoxLog.AppendText("Error aborting socket: [" + ex.GetType().Name + "] " + ex.Message + Environment.NewLine); } finally { RefreshDisplay(); } }