Ejemplo n.º 1
0
        public void transmit(string msgType, LCMEncodable lcmOut)
        {
            try
            {
                Utils.lcmTransmitterMessage("Transmitting {0} message", msgType);

                appLCM.Publish(msgType, lcmOut);
            }
            catch (Exception e)
            {
                Console.Error.WriteLine("Ex: " + e);
            }
        }
Ejemplo n.º 2
0
Archivo: LCM.cs Proyecto: eglrp/NaviX
        /// <summary>
        /// Publish an LCM-defined type on a channel. If more than one URL was
        /// specified, the message will be sent on each.
        /// </summary>
        /// <param name="channel">channel name</param>
        /// <param name="e">encodable object to send</param>
        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);
                }
            }
        }
Ejemplo n.º 3
0
		/// <summary>
		/// Publish an LCM-defined type on a channel. If more than one URL was
		/// specified, the message will be sent on each.
		/// </summary>
		/// <param name="channel">channel name</param>
		/// <param name="e">encodable object to send</param>
		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);
				}
			}
		}