AsterixDisplayAnalyser.RecForwConnection5.StopForwarding C# (CSharp) Метод

StopForwarding() публичный статический Метод

public static StopForwarding ( ) : void
Результат void
        public static void StopForwarding()
        {
            if (ListenForDataThread != null)
            {
                if (RecordingEnabled == false)
                {
                    RequestStop = true;
                    Thread.Sleep(200);
                    if (ListenForDataThread.IsAlive == true)
                    {
                        Cleanup();
                        ListenForDataThread.Abort();
                    }
                }

                ForwardingEnabled = false;
                if (tx_sock != null)
                    tx_sock.Close();
            }
        }

Usage Example

Пример #1
0
 private void checkBoxF5_CheckedChanged(object sender, EventArgs e)
 {
     if (this.checkBoxF5.Checked == true)
     {
         if (RecForwConnection5.StartForward(
                 //Source parameters (always passed in, however the connection manager will use it just in the case the
                 // connection is not active already)
                 IPAddress.Parse(this.listBoxLocalAddr.Items[4].ToString()),
                 IPAddress.Parse(this.listBoxIPAddress.Items[4].ToString()),
                 int.Parse(this.listBoxPort.Items[4].ToString()),
                 // Forward parameters
                 IPAddress.Parse(this.listBoxForwardingInterface.Items[4].ToString()),
                 IPAddress.Parse(this.listBoxForwardingMulticast.Items[4].ToString()),
                 int.Parse(this.listBoxForwardingPort.Items[4].ToString())) == false)
         {
             this.checkBoxF5.Checked = false;
         }
         else
         {
             this.progressBarF5.Visible = true;
         }
     }
     else
     {
         RecForwConnection5.StopForwarding();
         this.progressBarF5.Visible = false;
     }
 }