Menu

URLStream with timeout

Help
Andreas D.
2004-11-22
2012-11-20
  • Andreas D.

    Andreas D. - 2004-11-22

    I use URLSream to receive images from an IP-Camera. If I use it without timeout, the time for URLSream.get() and receive the hole image with URLStream.read() is about 20 mS. If I set a timeout (1000 mS), it takes about 800 mS to receive the imge.
    I have the same problem if I use tcpstream and read the http-header by my self.
    Have I something misunderstood?
    My system: WinXP SP2, VS.NET 2003, commonC++ 1.2.6

    Andreas

     
    • David Sugar

      David Sugar - 2004-12-22

      What does your code with timeout look like?

       
      • Andreas D.

        Andreas D. - 2005-01-03

        I use the demo 'urlfetch".

        I add the following code to the class myURLStream:

        public:
          myURLStream( timeout_t to=0 ) : URLStream( IPV4, to )
          {
          }

        In the main function I changed the first line to:
          myURLStream url( 1000 ); // 1 second timeout

        I remove all console output.

        I start time measuring before the get command and end after url.close(),

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.