static void Main() { IceApp app = null; try { app = new IceApp("MyTestAdapter", "localhost", 12000); hms.GenericEventInterfacePrx pub = app.getEventPublisher("MyTopic"); int count = 0; while ( true ) { Thread.Sleep(1000); count++; hms.Message msg = new hms.Message() ; msg.arguments = new System.Collections.Generic.Dictionary<string, string>(); msg.arguments.Add("counter", count.ToString()); msg.arguments.Add("arg1", "totoisback"); msg.arguments.Add("arg2", "somethingnew"); pub.putMessage(msg); Console.WriteLine("Message sent to MyTopic"); } } finally { if ( app != null ) { app.shutdown(); } } }
static void Main() { IceApp app = null; try { app = new IceApp("MyTestAdapter", "localhost", 12000); hms.GenericEventInterfacePrx pub = app.getEventPublisher("MyTopic"); int count = 0; while (true) { Thread.Sleep(1000); count++; hms.Message msg = new hms.Message(); msg.arguments = new System.Collections.Generic.Dictionary <string, string>(); msg.arguments.Add("counter", count.ToString()); msg.arguments.Add("arg1", "totoisback"); msg.arguments.Add("arg2", "somethingnew"); pub.putMessage(msg); Console.WriteLine("Message sent to MyTopic"); } } finally { if (app != null) { app.shutdown(); } } }
static void Main() { Console.WriteLine("Starting"); IceApp app = null; Holon holon = null; Robot robot = null; try { //app = new IceApp("localhost", 12000); app = new IceApp("MyTestAdapter", "localhost", 12000); holon = new Holon(app, "MyTestHolon"); robot = new Robot(app, "MyRobot"); Console.WriteLine(holon.Name + " starting"); app.subscribeEvent(holon, "MyTopic"); hms.GenericEventInterfacePrx pub = app.getEventPublisher("MyTopic"); Thread.Sleep(1000); hms.Message msg = new hms.Message(); msg.arguments = new System.Collections.Generic.Dictionary <string, string>(); msg.arguments.Add("mynewargs", "totoisback"); pub.putMessage(msg); Thread.Sleep(10000); pub.putMessage(msg); Console.WriteLine("Sleeping"); Thread.Sleep(10000); Console.WriteLine("Cleanup"); } finally { if (robot != null) { robot.shutdown(); } if (holon != null) { holon.shutdown(); } if (app != null) { app.shutdown(); } } }
static void Main() { Console.WriteLine ("Starting"); IceApp app = null; Holon holon = null; Robot robot = null; try { //app = new IceApp("localhost", 12000); app = new IceApp("MyTestAdapter", "localhost", 12000); holon = new Holon(app, "MyTestHolon"); robot = new Robot(app, "MyRobot"); Console.WriteLine(holon.Name + " starting"); app.subscribeEvent(holon, "MyTopic"); hms.GenericEventInterfacePrx pub = app.getEventPublisher("MyTopic"); Thread.Sleep(1000); hms.Message msg = new hms.Message() ; msg.arguments = new System.Collections.Generic.Dictionary<string, string>(); msg.arguments.Add("mynewargs", "totoisback"); pub.putMessage(msg); Thread.Sleep(10000); pub.putMessage(msg); Console.WriteLine ("Sleeping"); Thread.Sleep(10000); Console.WriteLine ("Cleanup"); } finally { if (robot != null ) { robot.shutdown(); } if (holon != null ) { holon.shutdown(); } if ( app != null ) { app.shutdown(); } } }
public virtual void put_message(hms.Message message, Ice.Current current) { logger.Warn("We got a new message but method is not implemented "); }
public override void putMessage(hms.Message msg, Ice.Current current) { log("Got a message from publisher: " + msg + msg.arguments["counter"]); }