コード例 #1
0
 private void InitializeClient()
 {
     if (_client != null)
     {
         _client?.Close();
         _client?.Dispose();
     }
     _client = new OscSender(IPAddress.Any, IPAddress.Loopback, _sys.Config.RequestPort);
     _client.Connect();
 }
コード例 #2
0
        private void Connect_Click(object sender, EventArgs e)
        {
            // if there is already an instace dispose of it
            if (m_Sender != null)
            {
                timer1.Enabled = false;
                AppendLine("Disconnecting");
                m_Sender.Dispose();
                m_Sender = null;
            }

            // get the ip address from the address box
            string addressString = m_AddressBox.Text;

            IPAddress ipAddress;

            // parse the ip address
            if (IPAddress.TryParse(addressString, out ipAddress) == false)
            {
                AppendLine(String.Format("Invalid IP address, {0}", addressString));

                return;
            }

            // create the sender instance
            m_Sender = new OscSender(ipAddress, (int)m_PortBox.Value);

            // tell the user
            AppendLine(String.Format("Connecting to: {0}:{1}", ipAddress, (int)m_PortBox.Value));

            try
            {
                // connect to the socket
                m_Sender.Connect();
            }
            catch (Exception ex)
            {
                AppendLine("Exception while connecting");
                AppendLine(ex.Message);

                m_Sender.Dispose();
                m_Sender = null;
            }
        }
コード例 #3
0
 public void Stop()
 {
     _isStopping = true;
     _resolumeOscSender.Dispose();
     _resolumeOscReceiver.Dispose();
     if (!_listenerThread.Join(1500))
     {
         _listenerThread.Abort();
     }
 }
コード例 #4
0
ファイル: OSCClient.cs プロジェクト: murrrkle/TILS
 public void Dispose()
 {
     if (!_isDisposed)
     {
         _isDisposed = true;
         _sender.Close();
         _sender.Dispose();
         _reciever.Close();
         _reciever.Dispose();
     }
 }
コード例 #5
0
    private void Disconnect()
    {
        // If the sender exists
        if (m_Sender != null)
        {
            // Disconnect the sender
            Debug.Log("Disconnecting Sender");

            m_Sender.Dispose();

            // Nullifiy the sender
            m_Sender = null;
        }
    }
コード例 #6
0
 private void Window_Closing(object sender, CancelEventArgs e)
 {
     oscSender.Dispose();
     oscHandler.StopReceiving();
     oscHandler2.StopReceiving();
 }
コード例 #7
0
 public void Shutdown()
 {
     sender.Close();
     sender.Dispose();
 }
        public override void Dispose()
        {
            oscReceiver.Dispose();

            oscSender.Dispose();
        }
コード例 #9
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting resources.
        /// </summary>
        public void Dispose()
        {
            Stop();

            sender.Dispose();
        }
コード例 #10
0
 private void OnDestroy()
 {
     _oscSender.Dispose();
 }