private void Form1_FormClosed(object sender, FormClosedEventArgs e) { client1.Disconnect(); host.CloseConnection(); }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { host.CloseConnection(); }
private void Grid_Unloaded(object sender, System.Windows.RoutedEventArgs e) { Server.CloseConnection(); //Closes all of the opened connections and stops listening }
private void MC_UI_FormClosing(object sender, FormClosingEventArgs e) { Nearest_Game.mcHasStarted = false; server.CloseConnection(); //Closes all of the opened connections and stops listening }
// there is a button to close the connection on the host form. private void Button1_Click(object sender, EventArgs e) { _host.CloseConnection(); }