public LLUPRouterService (string ipToBind, int portToBind, int servingPort, IRouterFilter filter) { // This call is required by the Windows.Forms Component Designer. InitializeComponent(); boundTo = new MessageClient(ipToBind, portToBind, "\r\n"); servingOn = new MessageServer(servingPort, "\r\n"); router = new RouterHandler(); router.ReceiverService = boundTo.Service; router.FilterService = servingOn.Service; if (filter != null) router.Filter = filter; }
public QsToLLUPService(string qsIp, int qsPort, int pubPort, string[] monitoredQueues) { // This call is required by the Windows.Forms Component Designer. InitializeComponent(); qsConnection = new MessageClient(qsIp, qsPort, "\r\n\r\n"); pubServer = new MessageServer(pubPort, "\r\n"); handler = new QSToLLUPHandler(); handler.PollService = qsConnection.Service; handler.DispatcherService = pubServer.Service; foreach(string queueId in monitoredQueues) { handler.MonitoredQueues.Add(queueId); } }
public LLUPSubscriberService(string[] bindAddresses, ISubscriber[] subscribers) { // This call is required by the Windows.Forms Component Designer. InitializeComponent(); boundTo = new MessageClient[bindAddresses.Length]; sub = new SubscriberHandler(); int index = 0; foreach(string address in bindAddresses) { string[] ipAndPort = address.Split(':'); MessageClient routerToBindTo = new MessageClient(ipAndPort[0], Convert.ToInt32(ipAndPort[1]), "\r\n"); sub.AddService(routerToBindTo.Service); boundTo[index] = routerToBindTo; index++; } this.subscribers = subscribers; foreach(ISubscriber s in subscribers) { s.Handler = sub; } }