Giter VIP home page Giter VIP logo

cling's People

Contributors

adetaylor avatar based2 avatar bergstr11 avatar christianbauer avatar ckovorodkin avatar cyberb avatar ened avatar gubatron avatar jomarmar avatar koush avatar md5555 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cling's Issues

Check all locale/encoding sensitive conversions

All the code of Cling should be inspected to not rely on the default locale or default encoding and explictely use "UTF-8" if appropriate. This include at least (but probably not limited):

  • uses of new String(bytes[]) (should use String(bytes[], "UTF-8") instead)
  • uses of String.getBytes()
  • uses of InputStreamReader(InputStream)
  • uses of OutputStreamReader(InputStream)
  • use of String.format(String, param) not sepcifying a locale as first parameter is the result string is not for display pupose but for a compuation.
  • uses of toLowerCase(), toUpperCase (what you patch do) and other String function where a locale/charset can be specified

Action user code should be able to check for cancellation

Action implementation code (for example a MediaServer Browse() action) should be able to check if the action has been aborted for example if:

  • the thread was interrupted with Thread.interrupt() (local and remote actions)
  • for remote actions, the socket connection was closed by the client before completion.

The action code should be able to call a function that return true if the action has been cancelled (or a function that throw InterruptedException).

It should work for both local and remote actions.

Use case:

Browse() action on a Media Server can be a long operation taking several seconds.
Currently, a remote client may choose to close the connection, aborting the action, but the Browse() action processing continue to execute for nothing.

See ReceivingAction.throwIfCancelled() for an example implementation using thread local storage:
https://github.com/bubbleguuum/cling/blob/ffc9bdd1e438ed85707694904aca4a376b588861/core/src/main/java/org/fourthline/cling/protocol/sync/ReceivingAction.java

Some state variables missing in AVTransportVariable

Some variables documented in the spec are missing in class org.teleal.cling.support.avtransport.lastchange.AVTransportVariable, e.g. RelativeTimePosition and AbsoluteTimePosition. This makes it difficult to use the LastChangeParser to read these variables.

Cling to Maven repository

Hi !
Cling seems to be a Maven build. However it can not be found from the central Maven repository.

Would it be too much to ask to upload it there, so it could be found using the "fourthline" and/or "cling" keywords and easily attached to other maven projects without having to download the JAR ? or is there something to prevent this?

Missing fourthline-skin.jar

When trying to build any of the Cling projects with Maven, this error occurs:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.0-beta-3:site (default-cli) on project cling-core: SiteToolException: ArtifactNotFoundException: The skin does not exist: Failure to find org.fourthline.site:fourthline-skin:jar:1.0 in http://4thline.org/m2 was cached in the local repository, resolution will not be reattempted until the update interval of 4thline-repo has elapsed or updates are forced

workbench standalong jar running failed

I cloned git source and built workbench. I got messages below when running standalong jar.

JarClassLoader: Warning: Null manifest from input stream associated with: lib/javax.inject-1.jar
JarClassLoader: Warning: javax/interceptor/InvocationContext.class in lib/ejb-api-3.0.jar is hidden by lib/jboss-interceptors-api_1.1_spec-1.0.0.Beta1.jar (with different bytecode)
Jan 18, 2012 5:05:46 PM org.jboss.weld.bootstrap.WeldBootstrap
INFO: WELD-000900 1.1.1 (Final)
Exception in thread "main" java.lang.ExceptionInInitializerError
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.simontuffs.onejar.Boot.run(Boot.java:340)
at com.simontuffs.onejar.Boot.main(Boot.java:166)
Caused by: java.lang.RuntimeException: Error handling file /workbench/target/cling-workbench-2.0-SNAPSHOT-standalone.jar
at org.jboss.weld.environment.se.discovery.url.FileSystemURLHandler.handleArchiveByFile(FileSystemURLHandler.java:97)
at org.jboss.weld.environment.se.discovery.url.FileSystemURLHandler.handle(FileSystemURLHandler.java:68)
at org.jboss.weld.environment.se.discovery.url.URLScanner.scan(URLScanner.java:117)
at org.jboss.weld.environment.se.discovery.url.WeldSEUrlDeployment.(WeldSEUrlDeployment.java:42)
at org.jboss.weld.environment.se.Weld.createDeployment(Weld.java:128)
at org.jboss.weld.environment.se.Weld.initialize(Weld.java:81)
at org.fourthline.cling.workbench.Workbench.(Workbench.java:38)
... 6 more
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:127)
at java.util.zip.ZipFile.(ZipFile.java:144)
at org.jboss.weld.environment.se.discovery.url.FileSystemURLHandler.handleArchiveByFile(FileSystemURLHandler.java:85)
... 12 more

Exception in NetworkAddressFactoryImpl.isInSubnet()

There's a bug in NetworkAddressFactoryImpl.isInSubnet() if netmask /8 == ip.length (for example if netmask=32, which I've seen happening).

An ArrayIndexOutOfBoundsException is thrown on the last line.

The fix is to check for this case:

while (prefix >= 8 && i < ip.length) {
...
}
if(i == ip.length) return true; // added line

Application crashes after switching WiFi Off then On and launching the application

Cling versions: 1.05, 1.1, 2.0

Android Devices/OS Versions:

  1. Nexus S / 4.1
  2. Motorola Droid RAZR / 4.0.4

The crash is easy to reproduce by turning WiFi Off and then On really quickly (i have used the default Android widget at the home screen).

09-18 10:42:06.820: E/AndroidRuntime(29918): java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x8000010 (has extras) } in org.teleal.cling.android.AndroidWifiSwitchableRouter$1@425dac90
09-18 10:42:06.820: E/AndroidRuntime(29918): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:765)
09-18 10:42:06.820: E/AndroidRuntime(29918): at android.os.Handler.handleCallback(Handler.java:615)
09-18 10:42:06.820: E/AndroidRuntime(29918): at android.os.Handler.dispatchMessage(Handler.java:92)
09-18 10:42:06.820: E/AndroidRuntime(29918): at android.os.Looper.loop(Looper.java:137)
09-18 10:42:06.820: E/AndroidRuntime(29918): at android.app.ActivityThread.main(ActivityThread.java:4745)
09-18 10:42:06.820: E/AndroidRuntime(29918): at java.lang.reflect.Method.invokeNative(Native Method)
09-18 10:42:06.820: E/AndroidRuntime(29918): at java.lang.reflect.Method.invoke(Method.java:511)
09-18 10:42:06.820: E/AndroidRuntime(29918): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
09-18 10:42:06.820: E/AndroidRuntime(29918): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-18 10:42:06.820: E/AndroidRuntime(29918): at dalvik.system.NativeStart.main(Native Method)
09-18 10:42:06.820: E/AndroidRuntime(29918): Caused by: org.teleal.cling.transport.SwitchableRouterImpl$RouterLockAcquisitionException: Failed to acquire router lock: WriteLock
09-18 10:42:06.820: E/AndroidRuntime(29918): at org.teleal.cling.transport.SwitchableRouterImpl.lock(SwitchableRouterImpl.java:211)
09-18 10:42:06.820: E/AndroidRuntime(29918): at org.teleal.cling.transport.SwitchableRouterImpl.lock(SwitchableRouterImpl.java:219)
09-18 10:42:06.820: E/AndroidRuntime(29918): at org.teleal.cling.android.AndroidWifiSwitchableRouter.enable(AndroidWifiSwitchableRouter.java:97)
09-18 10:42:06.820: E/AndroidRuntime(29918): at org.teleal.cling.android.AndroidWifiSwitchableRouter$1.onReceive(AndroidWifiSwitchableRouter.java:59)
09-18 10:42:06.820: E/AndroidRuntime(29918): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:755)
09-18 10:42:06.820: E/AndroidRuntime(29918): ... 9 more

can't search DMS device on network

my app doesn't in a wifi network environment, but local network(ip: 192.168.10.193). and my app can ping wifi gateway success(gateway: 192.168.6.168). my expectation is that searching DLNA devices on 192.168.6.168 network. but it failed. Can cling can resolove this issue? thanks.

Support for Android Wi-Fi P2P (Wi-Fi Direct)

We have used Cling for a prototype project relying on the Wi-Fi P2P android interface.

It is not supported yet but a quick workaround was to modify in the class org.teleal.cling.android.AndroidNetworkAddressFactory the method:
public static NetworkInterface getRealWifiNetworkInterface(WifiManager manager)

A wifi direct interface always has the term p2p along with its network interface name (this is identified by inspecting different wifi direct enable devices and many users and blogs suggest the same).

So this method code is altered in such a way that it loops through all available network interfaces until it finds one with name p2p.

Once found it will be returned as the network interface. If not any other available interface is returned.

A reliable support of Wi-Fi P2P probably needs more work as other classes may be affected.

Same Android Devices Couldn't Discovery Because Same UDN Created

-environment:
two or more SAME android devices
Under Android 2.2

-target source:
org.teleal.cling.model.types.UDN.java

public static UDN uniqueSystemIdentifier(String salt) { 

    java.net.InetAddress i = java.net.InetAddress.getLocalHost(); 
    systemSalt.append(i.getHostName()).append(i.getHostAddress()); 
    // Android always returns "localhost" and "127.0.0.1", not "192.168.0.xxx" 

-more details:
http://mailinglists.945824.n3.nabble.com/Same-Android-Devices-Couldn-t-Discovery-Because-Same-UDN-Created-tp3808695p3808695.html

android.os.NetworkOnMainThreadException

From ICS onwards doing any network operation in main thread will throw an exception. We need to change the onDestroy() of AndroidUpnpServiceImpl to asynchronously call svc.shutdown.

@OverRide
public void onDestroy() {
new Shutdown().execute(upnpService);
}

/**

  • 1.2.5 Do shutdown in separate thread else android.os.NetworkOnMainThreadException
  • @author Diwakar
    */
    class Shutdown extends AsyncTask<UpnpService, Void, Void>
    {
    @OverRide
    protected Void doInBackground(UpnpService... svcs) {
    UpnpService svc = svcs[0];
    if (null != svc) {
    _log.info("Call shutdown in background...");
    svc.shutdown();
    }
    return null;
    }
    }

ProtocolInfo.toString() throws an NPE for unknown protocols

I'll try to use XBMC as DMR and apparently XBMC supports a protocol xbmc-get.
Since the enum Protocol doesn't know about this protocol, it is nullified with Protocol.valueOrNullOf(String) and can't be stringified subsequently in ProtocolInfo.toString().

DLNA support for DIDL parser

Evaluate existing work, decide on feature set.

DLNA attributes should not be wrapped in DIDLObject.Property but in DIDLObject.Attribute.

Could not hydrate device or its services from descriptor: (RemoteDevice)

I'm using a EyeTV's Netstream SAT streamer in the network which descriptor doesn't seem to be digestable for cling 1.0:
WARNING: Could not hydrate device or its services from descriptor: (RemoteDevice) Identity: (RemoteDeviceIdentity) UDN: uuid:4df40997-9cd4-66d2-011b-3c0a00e6ded7, Descriptor: http://10.0.0.169:49152/description.xml, Root: true
Feb 19, 2013 5:23:01 PM org.teleal.cling.protocol.RetrieveRemoteDescriptors describe
Can't parse service type string (namespace/type/version): urn:schemas-microsoft-com:service:pbda:tuner:1

1 0 urn:schemas-microsoft-com:device:tv:pbda:1 EyeTV Netstream Sat #04014550 Elgato Systems GmbH http://www.elgato.com/ EyeTV Netstream Sat EyeTV Netstream Sat 1.00.00 http://www.elgato.com/ 04014550 uuid:7fcb69e7-7fd8-a74f-8ae2-63257ec0cc69 0FD9-0038 urn:schemas-upnp-org:device:MediaServer:1 EyeTV Netstream Sat (Tuner 1) Elgato Systems GmbH http://www.elgato.com/ EyeTV Netstream Sat EyeTV Netstream Sat 1.00.00 http://www.elgato.com/ 21493255 uuid:4df40997-9cd4-66d2-011b-3c0a00e6ded7 0FD9-0038 urn:schemas-upnp-org:service:ConnectionManager:1 urn:upnp-org:serviceId:ConnectionManager /tuner0/Service_ConnectionManager /tuner0/Service_ConnectionManager/control /tuner0/Service_ConnectionManager/event urn:schemas-upnp-org:service:AVTransport:1 urn:upnp-org:serviceId:AVTransport /tuner0/Service_AVTransport /tuner0/Service_AVTransport/control /tuner0/Service_AVTransport/event urn:schemas-microsoft-com:service:pbda:tuner:1 urn:microsoft-com:serviceId:pbda:tuner /tuner0/Service_Tuner /tuner0/Service_Tuner/control urn:schemas-microsoft-com:service:pbda:cas:1 urn:microsoft-com:serviceId:pbda:cas /tuner0/Service_CAS /tuner0/Service_CAS/control /tuner0/Service_CAS/event urn:schemas-microsoft-com:service:pbda:eventing:1 urn:microsoft-com:serviceId:pbda:eventing /tuner0/Service_Eventing /tuner0/Service_Eventing/control /tuner0/Service_Eventing/event urn:schemas-microsoft-com:service:pbda:gpnvs:1 urn:microsoft-com:serviceId:pbda:gpnvs /tuner0/Service_GPNVS /tuner0/Service_GPNVS/control urn:schemas-microsoft-com:service:pbda:mux:1 urn:microsoft-com:serviceId:pbda:mux /tuner0/Service_MUX /tuner0/Service_MUX/control urn:schemas-microsoft-com:service:pbda:useractivity:1 urn:microsoft-com:serviceId:pbda:useractivity /tuner0/Service_UserActivity /tuner0/Service_UserActivity/control urn:schemas-microsoft-com:service:pbda:guidedatadelivery:1 urn:microsoft-com:serviceId:pbda:guidedatadelivery /tuner0/Service_GuideDataDelivery /tuner0/Service_GuideDataDelivery/control urn:schemas-microsoft-com:service:pbda:debug:1 urn:microsoft-com:serviceId:pbda:debug /tuner0/Service_Debug /tuner0/Service_Debug/control urn:schemas-microsoft-com:service:pbda:drm:1 urn:microsoft-com:serviceId:pbda:drm /tuner0/Service_DRM /tuner0/Service_DRM/control urn:schemas-microsoft-com:service:pbda:diseqccommand:1 urn:microsoft-com:serviceId:pbda:diseqccommand /tuner0/Service_DiseqcCommand /tuner0/Service_DiseqcCommand/control http://10.0.0.169/ http://10.0.0.169:49152/

Filter Remote Devices

It would be nice to have a way to validate/filter the remote devices that cling discovers.
For example a FilterProvider that the Router or Register could be receive and run for every device before adding it to the register.

Long.Parse - NumberFormatException

Got this stack trace. We need to catch and return 0 for this exception in cling

java.lang.NumberFormatException: 01.000
at java.lang.Long.parse(Long.java:353)
at java.lang.Long.parseLong(Long.java:344)
at java.lang.Long.parseLong(Long.java:311)
at org.teleal.cling.model.ModelUtil.fromTimeString(ModelUtil.java:189)
at org.teleal.cling.support.model.PositionInfo.getTrackElapsedSeconds(PositionInfo.java:143)
at org.teleal.cling.support.model.PositionInfo.getElapsedPercent(PositionInfo.java:151)
at com.android.myapp.avtransport.AVTransportController$4.received(AVTransportController.java:191)
at org.teleal.cling.support.avtransport.callback.GetPositionInfo.success(GetPositionInfo.java:47)
at org.teleal.cling.controlpoint.ActionCallback.run(ActionCallback.java:156)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
at java.lang.Thread.run(Thread.java:1019)

thanks,
-D

Cannot control cling renderers volume with WMP12

WMP12 "Play to" will disable volume controls with Cling renderers.

WMP12 doesn't like "retval" tags found in the RenderingControl service XML generated by class UDA10ServiceDescriptorBinderImpl.

It is safe to not include this tag for all services (most other service XML definitions from other UPnP software do not include it):

private void generateActionArgument(ActionArgument actionArgument, Document descriptor, Element actionElement) {

    Element actionArgumentElement = appendNewElement(descriptor, actionElement, ELEMENT.argument);

    appendNewElementIfNotNull(descriptor, actionArgumentElement, ELEMENT.name, actionArgument.getName());
    appendNewElementIfNotNull(descriptor, actionArgumentElement, ELEMENT.direction, actionArgument.getDirection().toString().toLowerCase());
    appendNewElementIfNotNull(descriptor, actionArgumentElement, ELEMENT.relatedStateVariable, actionArgument.getRelatedStateVariableName());

    /*
    // WMP will disable the RenderingControl Service with this tag
    if (actionArgument.isReturnValue()) {
        appendNewElement(descriptor, actionArgumentElement, ELEMENT.retval);
    }
    */
}

Exception in IncomingSubscribeResponseMessage.getSubscriptionDurationSeconds()

Using cling on an android system this exception was reported through Google Play

Exception class java.lang.NullPointerException
Source method IncomingSubscribeResponseMessage.getSubscriptionDurationSeconds()
java.lang.NullPointerException
at org.fourthline.cling.model.message.gena.IncomingSubscribeResponseMessage.getSubscriptionDurationSeconds(IncomingSubscribeResponseMessage.java:47)
at org.fourthline.cling.protocol.sync.SendingRenewal.executeSync(SendingRenewal.java:85)
at org.fourthline.cling.protocol.sync.SendingRenewal.executeSync(SendingRenewal.java:42)
at org.fourthline.cling.protocol.SendingSync.execute(SendingSync.java:55)
at org.fourthline.cling.protocol.SendingAsync.run(SendingAsync.java:44)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
at java.lang.Thread.run(Thread.java:1019)

Add method to get address of connected client

While being in Service, (especially in ContentDirectoryService) it's sometimes needed to be aware of address of client that is now connected. Other related information is the interface that the client connected to (machine can have two or more interfaces, and that makes it hard to return appropriate resource address).

IncomingActionRequestMessage should have two methods: getLocalAddress and GetRemoteAddress .

Cling couldn't get IP address on Android Wi-Fi Direct network

-environment:
two or more android devices connect on Wi-Fi Direct each other
run cling, then IP address always returns zero

-target source:

org.teleal.cling.android.AndroidNetworkAddressFactory.java

public static NetworkInterface getRealWifiNetworkInterface(WifiManager manager) {

    //.... 

    int wifiIP = manager.getConnectionInfo().getIpAddress(); 
    // when device connectd by Wi-Fi Direct, getIpAddress () is always returns "0" 

    //....

-more details:
http://mailinglists.945824.n3.nabble.com/Cling-couldn-t-get-IP-address-on-Android-Wi-Fi-Direct-network-td3740102.html

TransportStatus Issue

In the class org.fourthline.cling.support.model.TransportStatus the status ERROR_OCCURRED is misspelled as ERROR_OCCURED (notice the missing 'R'). This causes the last change parser to fail when attempting to parse this transport status.

class support.avtransport.impl.state.Playing does not pass type parameter

the class org.fourthline.cling.support.avtransport.impl.state.Playing should pass the type parameter to the superclass. Currently, the class definition reads:

public abstract class Playing<T extends AVTransport> extends AbstractState {

it should however be:

public abstract class Playing<T extends AVTransport> extends AbstractState<T> {

the same goes for class Stopped.

Seek Error

Is there known issue with seek? I am getting an error back :

current state of service prevents invoking that action. Action method invocation failed: Invalid int: "REL_COUNT". (HTTP response was 500 Internal Server Error)

All other commands are fine, including setURI, play, stop, pause ... etc.

NetworOnMainThreadException in AnroidUpnpService#onDestroy

I am occasionally seeing the exception below when my app terminates after bein launched from the IDE (i.e., in strict mode). Interestingly, it does not happen all the time, and I assume it wont happen in a production environment which doesnt impose strict mode. Still, the underlying issue seems to exist.

OS: Android 4.03
Device: ASUS EeePad Transformer

Caused by: android.os.NetworkOnMainThreadException
at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1099)
at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:163)
at libcore.io.IoBridge.recvfrom(IoBridge.java:503)
at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
at com.bubblesoft.org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:149)
at com.bubblesoft.org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:110)
at com.bubblesoft.org.apache.http.impl.io.SocketInputBuffer.isDataAvailable(SocketInputBuffer.java:121)
at com.bubblesoft.org.apache.http.impl.AbstractHttpClientConnection.isStale(AbstractHttpClientConnection.java:310)
at com.bubblesoft.org.apache.http.impl.conn.AbstractClientConnAdapter.isStale(AbstractClientConnAdapter.java:174)
at com.bubblesoft.org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:406)
at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:821)
at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:942)
at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:920)
at com.bubblesoft.org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:911)
at org.fourthline.cling.transport.impl.apache.StreamClientImpl.sendRequest(StreamClientImpl.java:137)
at org.fourthline.cling.transport.RouterImpl.send(RouterImpl.java:282)
at org.fourthline.cling.transport.SwitchableRouterImpl.send(SwitchableRouterImpl.java:211)
at org.fourthline.cling.protocol.sync.SendingUnsubscribe.executeSync(SendingUnsubscribe.java:55)
at org.fourthline.cling.protocol.SendingSync.execute(SendingSync.java:55)
at org.fourthline.cling.protocol.SendingAsync.run(SendingAsync.java:44)
at org.fourthline.cling.registry.RemoteItems.shutdown(RemoteItems.java:306)
at org.fourthline.cling.registry.RegistryImpl.shutdown(RegistryImpl.java:385)
at org.fourthline.cling.UpnpServiceImpl.shutdown(UpnpServiceImpl.java:131)
at org.fourthline.cling.android.AndroidUpnpServiceImpl.onDestroy(AndroidUpnpServiceImpl.java:101)
at android.app.ActivityThread.handleStopService(ActivityThread.java:2389)
... 10 more

[osgi] Event UNREGISTERING is not fired to ServiceListeners

Previously reported here: http://code.google.com/p/bwgz-org/issues/detail?id=1

What steps will reproduce the problem?

  1. Launch the basedriver
  2. Launch a remote UPnP Device
  3. Register a ServiceListener with the right filter in order to see the device
  4. Stop the UPnP device

The expected behaviour: An event serviceChanged(ServiceEvent.UNREGISTERING) should be thrown to the ServiceListener which is not happening.

Version: 2.0-SNAPSHOT as of nov.9 2011, on felix.

In org.fourthline.cling.osgi.basedriver.discover.ClingRegistryListener:122, there is context.ungetService(data.getServiceReference());
In order to correctly throw events, it has to call ServiceRegistration.unregister().
I slightly modified UPnPDeviceBinding to keep registration instead of reference and it's working.

Old 1.1 sourcecode is available as an attachment of the original issue, but no changes have been made and is applicable to 2.0.

Cling identifies VirtualBox interface as usable

When VirtualBox is installed on the same computer running Cling, Cling will mistakenly identify the virtual interface created by VirtualBox as usable. Once it does, Cling seems to be unable to successfully discover any upnp sources. Cling already filters out an interface if it is identified as being created by vmware. This is the same situation. Just a different vm software. I corrected the issue by performing a check for the VirtualBox interface and skipping it if it is detected. The code change was in NetworkAddressFactoryImpl.isUsableNetworkInterface().

This is the code that was added to fix it:

if (iface.getName().toLowerCase().startsWith("virtualbox") ||
(iface.getDisplayName() != null && iface.getDisplayName().toLowerCase().contains("virtualbox"))) {
log.finer("Skipping network interface (VirtualBox): " + iface.getDisplayName());
return false;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.