Beispiel #1
0
        public async Task SubscribeToEvents(GenaSubscriptionHandler handler, string callbackUrl, int timeout)
        {
            if (_subscription != null)
            {
                return;
            }

            GenaSubscriptionRequest request = new GenaSubscriptionRequest()
            {
                BaseAddress   = new Uri(Service.BaseUrl),
                PublisherPath = Service.EventSubUrl,
                Timeout       = timeout,
                Callback      = callbackUrl
            };

            _subscription = await handler.Subscribe(request);

            _subscription.OnNotify += HandleOnNotify;

            if (_subscription.LastOnNotify != null)
            {
                HandleOnNotify(null, _subscription.LastOnNotify);
            }
        }
Beispiel #2
0
 public UPnPServer(GenaSubscriptionHandler handler)
 {
     Handler = handler;
 }
Beispiel #3
0
 public UPnPServer()
 {
     Handler = new GenaSubscriptionHandler();
 }