Menu

Problem with subscribe(...)

Help
2006-01-19
2013-04-29
  • Christian Henz

    Christian Henz - 2006-01-19

    Hi all!

    I'm currently hacking on the VLC UPnP service discovery module (http://trac.videolan.org/vlc/file/trunk/modules/services_discovery/upnp.cpp), which uses CyberLink.

    I want to subscribe to the ContentDirectory service of all the media servers found and my code looks like this:

    Device* dev;
    [...]
    Service* cds = dev->getService(ContentDirectory::SERVICE_TYPE);
    if (cds && !isSubscribed(cds)) subscribe(cds, 10);

    This causes a problem with a certain media server (TwonkyVision v2.4), where the subscribe(,,,) call does not return! (It works with some other servers like TwonkyVision v3.0 trial and uShare)

    The following backtrace suggests that the call ultimately results in a recv(..) call that just blocks while not getting any data:

    #0  0xb7f836fe in recv () from /lib/tls/libpthread.so.0
    #1  0xb7c5017c in CyberNet::Socket::recv (this=0xfffffe00, buffer=0xb16ea008 "", bufferLen=1) at ../../src/cybergarage/net/Socket.cpp:292
    #2  0xb7c509df in CyberNet::SocketInputStream::read (this=0xb345c1c0, b=@0xb345c18c, len=1) at ../../src/cybergarage/net/SocketInputStream.cpp:66
    #3  0xb7c3d2da in CyberIO::BufferedReader::readLine (this=0xb345c188) at ../../src/cybergarage/io/BufferedReader.cpp:33
    #4  0xb7c4374d in CyberHTTP::HTTPPacket::set (this=0xb345c298, in=0xb345c1c0, onlyHeaders=false) at ../../src/cybergarage/http/HTTPPacket.cpp:222
    #5  0xb7c43b2c in CyberHTTP::HTTPPacket::set (this=0xb345c298, sock=0x831f450, onlyHeaders=false) at ../../src/cybergarage/http/HTTPPacket.cpp:340
    #6  0xb7c4569d in CyberHTTP::HTTPRequest::post (this=0xb345c260, host=0x82de40c "XXX.XXX.XXX.XXX", port=8080, httpRes=0xb345c298, isKeepAlive=false)
        at ../../src/cybergarage/http/HTTPRequest.cpp:290
    #7  0xb7c1de72 in CyberLink::ControlPoint::subscribe (this=0xb6ada344, service=0xb1a03c48, timeout=10) at HTTPRequest.h:261

    Now the question is if I'm doing something wrong with the subscription, or if this would be a bug in TwonkyVision v2.4. In the latter case I think CyberLink has to be robust enough to handle it, maybe via some additional timeout mechanism?

     
    • Christian Henz

      Christian Henz - 2006-01-26

      Small update:

      I tried the same thing using libupnp, and it gives me an error, saying that the server did not accept the subscription.

      So is there a way for me to know if the subscription will be accepted in advance, or is this a bug in CyberLink?

      cheers,
      Christian Henz

       
      • Satoshi Konno

        Satoshi Konno - 2006-01-27

        Hi,

        To check your problem, I will install the media server in my home.

        I checked the home page, I knew the latest version is 3.0. I will check using the version.

        Please wait for while :-)

         
    • Christian Henz

      Christian Henz - 2006-01-27

      Hi!

      Thanks for looking into this! The problem does NOT occur with the 3.0 version though, only with 2.4.

      Unfortunately, version 2.4 is no longer available on the Twonkyvision site. Maybe I can contact them next week and ask for it.

      cheers,
      Christian Henz

       
      • Satoshi Konno

        Satoshi Konno - 2006-01-27

        Hi,

        Please tell me if you can get the package :-)

         

Log in to post a comment.