Exemple #1
0
        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;
        }
Exemple #2
0
	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);
	    }
	  }
Exemple #3
0
	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;
	    }
        }