cling-2.0-SNAPSHOT (08.12.12) : Problem with SUBSCRIBE/UNSUBSCRIBE

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

cling-2.0-SNAPSHOT (08.12.12) : Problem with SUBSCRIBE/UNSUBSCRIBE

Draško
This post was updated on .
I am trying to get notified when a subscription get added/removed. Hence I have extended the UpnpServiceImpl with:


                        @Override
                        protected Registry createRegistry(ProtocolFactory protocolFactory) {
                                return new RegistryImpl(this) {

                                        @Override
                                        public synchronized void addLocalSubscription(LocalGENASubscription subscription) {
                                                Ln.d("RegistryImpl.addLocalSubscription(): subscription = %s", subscription);
                                                super.addLocalSubscription(subscription);
                                        }

                                        @Override
                                        public synchronized boolean removeLocalSubscription(LocalGENASubscription subscription) {
                                                Ln.d("RegistryImpl.removeLocalSubscription(): subscription = %s", subscription);
                                                return super.removeLocalSubscription(subscription);
                                        }

                                };
                        }

Unfortunately, for the SUBSCRIBE operation I get both, addLocalSubscription and removeLocalSubscription, callbacks. The following log shows that in relation with createReceivingSync callbacks:

01-08 16:45:10.077: D//ClingBasedUpnpService.java:156(15939): cling-6 ProtocolFactoryImpl.createReceivingSync(): message = (StreamRequestMessage) SUBSCRIBE /dev/e6ed39c4-5bfd-7217-0000-0000458e7a3c/svc/upnp-org/ConnectionManager/event
01-08 16:45:10.108: D//ClingBasedUpnpService.java:170(15939): cling-6 RegistryImpl.addLocalSubscription(): subscription = (GENASubscription, SID: uuid:46ef234a-a2a6-49cb-ad6e-7e0f5554754e, SEQUENCE: 0)
01-08 16:45:10.217: D//ClingBasedUpnpService.java:176(15939): cling-6 RegistryImpl.removeLocalSubscription(): subscription = (GENASubscription, SID: uuid:46ef234a-a2a6-49cb-ad6e-7e0f5554754e, SEQUENCE: 1)
01-08 16:45:10.233: D//ClingBasedUpnpService.java:156(15939): cling-8 ProtocolFactoryImpl.createReceivingSync(): message = (StreamRequestMessage) SUBSCRIBE /dev/e6ed39c4-5bfd-7217-0000-0000458e7a3c/svc/upnp-org/ContentDirectory/event
01-08 16:45:10.241: D//ClingBasedUpnpService.java:170(15939): cling-8 RegistryImpl.addLocalSubscription(): subscription = (GENASubscription, SID: uuid:b70d427f-ee7e-404e-a49a-f25134d8178d, SEQUENCE: 0)
01-08 16:45:10.288: D//ClingBasedUpnpService.java:176(15939): cling-8 RegistryImpl.removeLocalSubscription(): subscription = (GENASubscription, SID: uuid:b70d427f-ee7e-404e-a49a-f25134d8178d, SEQUENCE: 1)

I am not sure if this is fixed in the current 2.0-ALPHA1 release as I am having some issues migrating my code.
Reply | Threaded
Open this post in threaded view
|

Re: cling-2.0-SNAPSHOT (08.12.12) : Problem with SUBSCRIBE/UNSUBSCRIBE

Christian Bauer
Administrator

It is pointless speculating about random old code snapshots.

Reply | Threaded
Open this post in threaded view
|

Re: cling-2.0-SNAPSHOT (08.12.12) : Problem with SUBSCRIBE/UNSUBSCRIBE

Draško
The behavior is better in the latest release (2.0-alpha1). There are no unnecessary invocations of removeLocalSubscription. Unfortunately, also no invocation of removeLocalSubscription when UNSUBSCRIBE is received. Design or misbehavior?
Reply | Threaded
Open this post in threaded view
|

Re: cling-2.0-SNAPSHOT (08.12.12) : Problem with SUBSCRIBE/UNSUBSCRIBE

Christian Bauer
Administrator
So, what you are saying is that the code in ReceivingUnscribe isn't doing anything and that the tests are wrong. I think it's more likely you haven't read that code, or the tests. If you want to poke your finger into the guts of Cling, please actually read the code. That's why it is open source!
Reply | Threaded
Open this post in threaded view
|

Re: cling-2.0-SNAPSHOT (08.12.12) : Problem with SUBSCRIBE/UNSUBSCRIBE

Draško
This post was updated on .
You are right, I haven't read that code nor the tests. Until now I didn't want to as I need to focus on the app. Hence I am testing it "blackbox". So, what I am saying is that I can log SUBSCRIBE and UNSUBSCRIBE messages, but only get callbacks to addLocalSubscription (and no removeLocalSubscription).
I can't escape the feeling that you are easily getting annoyed with posts here. Maybe you should rename the mailing list into "Cling developers" if you expect that every poster should be familiar with the cling internals. Just a thought.
Reply | Threaded
Open this post in threaded view
|

Re: cling-2.0-SNAPSHOT (08.12.12) : Problem with SUBSCRIBE/UNSUBSCRIBE

Christian Bauer
Administrator
Of course I expect everyone to read the Cling source who posts here! Not doing this is simply disrespectful, you ware wasting everyones time. Even Cling "users" should be software engineers. Who else do you think is here? Car mechanics? Pilots?

Reply | Threaded
Open this post in threaded view
|

Re: cling-2.0-SNAPSHOT (08.12.12) : Problem with SUBSCRIBE/UNSUBSCRIBE

bergstr
hehe, a true Christian Bauer. But true also.
Reply | Threaded
Open this post in threaded view
|

Re: cling-2.0-SNAPSHOT (08.12.12) : Problem with SUBSCRIBE/UNSUBSCRIBE

ash5
In reply to this post by Christian Bauer
I agree Chris, I learnt it the hard way.

As long as you dont run into issues, its good to use it as 'blackbox' But when you have problems, 'always read code'