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

Publish() public method

Publish an LCM-defined type on a channel. If more than one URL was specified, the message will be sent on each.
public Publish ( string channel, LCMEncodable e ) : void
channel string channel name
e LCMEncodable encodable object to send
return void
		public void Publish(string channel, LCMEncodable e)
		{
            if (this.closed)
            {
                throw new SystemException();
            }
				
			lock (this)
			{
				try
				{
					encodeBuffer.Reset();
					
					e.Encode(encodeBuffer);
					
					Publish(channel, encodeBuffer.Buffer, 0, encodeBuffer.Length);
				}
				catch (System.IO.IOException ex)
				{
					Console.Error.WriteLine("LC Publish fail: " + ex);
				}
			}
		}
		

Same methods

LCM::Publish ( string channel, byte data, int offset, int length ) : void
LCM::Publish ( string channel, string s ) : void

Usage Example

Example #1
0
        public void discover(string input)
        {
            _ea.GetEvent <StatusUpdateEvent>().Publish("Discovering...");
            discovery_request_t discoveryRequest = new discovery_request_t();

            _lcm.Publish(Channels.discovery_req_channel, discoveryRequest);
        }
All Usage Examples Of LCM.LCM.LCM::Publish