Пример #1
0
 public Connection(string ip, int brokerPort, int listenPort, bool dontFragment = false)
 {
     _udpconn = new UdpCommunication();
     _udpconn.SetUpUdpComponent(10, 500, dontFragment);
     _listenPort = listenPort;
     _ip         = ip;
     _brokerPort = brokerPort;
 }
Пример #2
0
 private static void Initialize()
 {
     Debug.WriteLine("Initializing HarakaMQ");
     Setup.Initialize();
     _udpCommunication = Setup.container.GetInstance <IUdpCommunication>();
     _udpCommunication.SetUpUdpComponent(10, 2000, false, Setup.container.GetInstance <IJsonConfigurator>().GetSettings().Brokers.Select(x => x.Ipaddress + x.Port).ToArray());
     _udpCommunication.QueueDeclare       += QueueDeclareMessageRecieved;
     _udpCommunication.PublishPackage     += PublishMessageRecieved;
     _udpCommunication.Subscribe          += SubsribeMessageRecieved;
     _udpCommunication.AntiEntropyMessage += AntiEntropyMessageMessageReceived;
     _udpCommunication.Listen(Setup.container.GetInstance <IJsonConfigurator>().GetSettings().BrokerPort);
     _gossip = Setup.container.GetInstance <IGossip>();
     _gossip.StartGossip();
 }