LCM.LCM.LCM.Close C# (CSharp) Method

Close() public method

Call this function to release all resources used by the LCM instance. After calling this function, the LCM instance should consume no resources, and cannot be used to receive or transmit messages.
public Close ( ) : void
return void
		public void Close()
		{
			if (this.closed)
            {
				throw new SystemException();
            }

			lock (this)
			{
				foreach (Provider p in providers)
				{
					p.Close();
				}

				providers = null;
				this.closed = true;
			}
		}
		

Usage Example

Example #1
0
    public void changeURL(string newURL)
    {
        // Close connection to previous URL
        myLCM.Close();

        // Set new URL
        setURL(newURL);
    }