Example #1
0
        protected override void OnClosing(CancelEventArgs e)
        {
            if (host.IsListening)
            {
                host.StopListening();
            }
            else if (host.IsConnected)
            {
                host.Disconnect(true);
            }

            base.OnClosing(e);
        }
Example #2
0
 public void connect()
 {
     if (host.IsListening)
     {
         host.StopListening();
     }
     else if (host.IsConnected)
     {
         host.Disconnect(true);
     }
     else
     {
         host.StartListening();
     }
 }