Exemple #1
0
 public bool Disconnect()
 {
     try
     {
         connected = false;
         reader.Close();
         writer.Close();
         stream.Close();
         tcpClient.Close();
         Console.WriteLine("Disconnected.");
         clientForm.UserListBox_Remove(all: true);
         return(true);
     }
     catch (Exception ex)
     {
         connected = true;
         Console.WriteLine("Exception: " + ex.Message);
         return(false);
     }
 }