protected override void OnClosing(CancelEventArgs e) { if (host.IsListening) { host.StopListening(); } else if (host.IsConnected) { host.Disconnect(true); } base.OnClosing(e); }
public void connect() { if (host.IsListening) { host.StopListening(); } else if (host.IsConnected) { host.Disconnect(true); } else { host.StartListening(); } }