private void InitializeClient() { if (_client != null) { _client?.Close(); _client?.Dispose(); } _client = new OscSender(IPAddress.Any, IPAddress.Loopback, _sys.Config.RequestPort); _client.Connect(); }
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; } }
public void Stop() { _isStopping = true; _resolumeOscSender.Dispose(); _resolumeOscReceiver.Dispose(); if (!_listenerThread.Join(1500)) { _listenerThread.Abort(); } }
public void Dispose() { if (!_isDisposed) { _isDisposed = true; _sender.Close(); _sender.Dispose(); _reciever.Close(); _reciever.Dispose(); } }
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; } }
private void Window_Closing(object sender, CancelEventArgs e) { oscSender.Dispose(); oscHandler.StopReceiving(); oscHandler2.StopReceiving(); }
public void Shutdown() { sender.Close(); sender.Dispose(); }
public override void Dispose() { oscReceiver.Dispose(); oscSender.Dispose(); }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting resources. /// </summary> public void Dispose() { Stop(); sender.Dispose(); }
private void OnDestroy() { _oscSender.Dispose(); }