private void actionSend() { try { //Creation de la socket locale localSocketSending = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); buffer = new byte[1024 * 512]; buffer = ASCIIEncoding.ASCII.GetBytes(obj.Serialise()); localSocketSending.Connect(targetAdress); if (localSocketSending.Connected) { //Envoi du message localSocketSending.Send(buffer); } threadListenAndReceive.Start(); localSocketSending.Close(); threadSend.Abort(); } catch (Exception ex) { if (this.threadListenAndReceive != null) { //Arreter le thread d'ecoute en attente this.threadListenAndReceive.Abort(); } localSocketSending.Close(); threadSend.Abort(); MessageBox.Show("Methode Action send : " + ex.Message); } }