/// <summary> /// Cierra la conexion a esta mquina remota.. los thread abort exception no detienen la ejecución /// </summary> public void close() { if (Interlocked.CompareExchange(ref closePoint, 1, 0) == 0) { try { senderStream.Close(0); } catch (ThreadAbortException e) { throw e; } catch (Exception) { } try { NetworkStream nStream = TcpClient.GetStream(); nStream.Close(0); } catch (ThreadAbortException e) { throw e; } catch (Exception) { } try { TcpClient.Client.Close(); } catch (ThreadAbortException e) { throw e; } catch (Exception) { } try { TcpClient.Close(); } catch (ThreadAbortException e) { throw e; } catch (Exception) { } try { ClientThread.Abort(); ClientThread.Join(); } catch (ThreadAbortException e) { throw e; } catch (Exception) { } closePoint = 0; } }