Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Discovery blocked with a bad upnp device

Help
Olivier
2010-04-30
2013-05-02
  • Olivier
    Olivier
    2010-04-30

    Hi, on my network, i have a upnp device (not a cyberlink upnp device). This device is badly disabled, it answer to the SSDP request, but doesn't answer to the locationUrl request.

    The problem is that the cyberlink discovery is not multi-threaded, and a bad device can block it.

    I just suggest to use a ThreadPoolExecutor, in the ControlPoint class, something like this :

    private final ThreadPoolExecutor threadPool;
    public ControlPoint(int ssdpPort, int httpPort) {
        ...
        threadPool = new ThreadPoolExecutor( ... )
    }
    public synchronized void searchResponseReceived(final SSDPPacket packet)
    {
        threadPool.execute(new Runnable() {
            public void run() {
                addDevice(packet);
                performSearchResponseListener(packet);
            }           
        });     
    }