示例#1
0
        public static void addToTopic(Venta v)
        {
            publisher = new TopicPublisher(TOPIC_NAME, BROKER);

            var javaScriptSerializer = new JavaScriptSerializer();
            String item = javaScriptSerializer.Serialize(v);

            publisher.SendMessage(item);
        }
示例#2
0
        public void broadcastPuja(Puja p)
        {
            const string TOPIC_NAME = "Pujas";
            const string BROKER = "tcp://localhost:61616";
            TopicPublisher publisher;

            publisher = new TopicPublisher(TOPIC_NAME, BROKER);

            var javaScriptSerializer = new JavaScriptSerializer();
            String item = javaScriptSerializer.Serialize(p);

            publisher.SendMessage(item);
        }
示例#3
0
        public void informarVentaFinalizada(Venta v, Usuario comprador)
        {
            //Informar a los pujadores de la venta finalizada (TOPIC)
            const string TOPIC_NAME = "Ventas";
            const string BROKER = "tcp://localhost:61616";
            TopicPublisher publisher;

            publisher = new TopicPublisher(TOPIC_NAME, BROKER);
            v.comprador = comprador.Nombre;

            var javaScriptSerializer = new JavaScriptSerializer();
            String item = javaScriptSerializer.Serialize(v);
            //Debug.WriteLine(item);
            publisher.SendMessage(item);
        }