public void PublishEvent(String event_name, Uri sender_address, EventData[] data)
        {
            Console.WriteLine("***Event Published, event_identifier:{0}***", event_name);
            Console.WriteLine("***Publisher Service address{0}***", sender_address.ToString());
            List <ReciverEndpointInfo> uris;

            lock (this._registrations)
            {
                uris = _registrations.SingleOrDefault(o => o.Key == event_name).Value;
            }
            Console.WriteLine("***Detected {0} subscribciones***", uris == null?0:uris.Count);
            if (foreward)
            {
                Action <String, Uri, EventData[]> forewardFunc = (s, u, d) =>
                {
                    ChannelFactory <IPubSubEventAPI> factory = new ChannelFactory <IPubSubEventAPI>("IPubSub_Foreward");
                    try
                    {
                        IPubSubEventAPI client = factory.CreateChannel();
                        client.PublishEvent(event_name, sender_address, data);
                        Console.WriteLine("**Event Forewarded**");
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("**No se pudo establecer el canal de comunicacion con el Servicio PubSub de nivel superior**");
                        Console.WriteLine("**Detalle de la excepcion:{0}**" + e.Message);
                    }
                };
                forewardFunc.BeginInvoke(event_name, sender_address, data, null, null);
            }
            if (uris != null)
            {
                foreach (ReciverEndpointInfo r in uris)
                {
                    Action <String, Uri, EventData[]> notify = (s, u, d) =>
                    {
                        ChannelFactory <IEventReciver> factory = new ChannelFactory <IEventReciver>("IEventReciver", new EndpointAddress(r.Address));
                        try
                        {
                            IEventReciver client = factory.CreateChannel();
                            client.ReciveEvent(s, u, d);
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine("**No se pudo establecer el canal de comunicacion con el Cliente Subscrito{0}**, Detalle:{1}", r.Address, " " + e.Message);
                            Console.WriteLine("**Detalle de la excepcion:{0}**" + e.Message);
                        }
                    };
                    notify.BeginInvoke(event_name, sender_address, data, null, r);
                }
            }
            else
            {
                Console.WriteLine("***No existen subscripciones para el evento***");
            }
        }
        public void Register(int eventId, IEventReciver reciver)
        {
            List <IEventReciver> reciverList;

            if (!_eventReciverMap.TryGetValue(eventId, out reciverList))
            {
                reciverList = new List <IEventReciver>();
                _eventReciverMap.Add(eventId, reciverList);
            }
            if (!reciverList.Contains(reciver))
            {
                reciverList.Add(reciver);
            }
        }
        public void Remove(int eventId, IEventReciver reciver)
        {
            List <IEventReciver> reciverList;

            if (_eventReciverMap.TryGetValue(eventId, out reciverList))
            {
                int i;
                int count = reciverList.Count;
                for (i = 0; i < count; i++)
                {
                    if (reciverList[i] == reciver)
                    {
                        reciverList[i] = null;
                    }
                }
            }
        }