Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CInternetSession Problem

CInternetSession Problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Amar Sutar
    wrote on last edited by
    #1

    Hi, I am writing an appliction which downloads MJPEG stream from IP camera. My application supports many IP cameras at a time. So i need to download several URL at a time from single instance. But the problem is when I add my fifth camera my application gets hanged. So is there any limit on how many URLs we can open using CInternetSession's OpenURL method? From my application I am able to open upto 4 URLs for one instance. For fifth URL my application give "timeout" exception. Code: CStdioFile* m_pFile[5]; CInternetSession m_inetSession[5]; for(int iIndex = 0; iIndex < 5; ++iIndex) { m_pFile[iIndex] = m_inetSession[iIndex].OpenURL (cstrUrl, 1, INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_RELOAD); . . } Thanks in Advance. Amar :)

    D 1 Reply Last reply
    0
    • A Amar Sutar

      Hi, I am writing an appliction which downloads MJPEG stream from IP camera. My application supports many IP cameras at a time. So i need to download several URL at a time from single instance. But the problem is when I add my fifth camera my application gets hanged. So is there any limit on how many URLs we can open using CInternetSession's OpenURL method? From my application I am able to open upto 4 URLs for one instance. For fifth URL my application give "timeout" exception. Code: CStdioFile* m_pFile[5]; CInternetSession m_inetSession[5]; for(int iIndex = 0; iIndex < 5; ++iIndex) { m_pFile[iIndex] = m_inetSession[iIndex].OpenURL (cstrUrl, 1, INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_RELOAD); . . } Thanks in Advance. Amar :)

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Since CInternetSession class is a wrapper around InternetOpenUrl(), you could temporarily change your code to use InternetOpenUrl() instead. When/if it fails, you can call GetLastError() to find out why.

      "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

      A 1 Reply Last reply
      0
      • D David Crow

        Since CInternetSession class is a wrapper around InternetOpenUrl(), you could temporarily change your code to use InternetOpenUrl() instead. When/if it fails, you can call GetLastError() to find out why.

        "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        A Offline
        A Offline
        Amar Sutar
        wrote on last edited by
        #3

        GetLastError() returns error code 12002.

        M 1 Reply Last reply
        0
        • A Amar Sutar

          GetLastError() returns error code 12002.

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          From the docs: ERROR_INTERNET_TIMEOUT 12002 The request has timed out. Are you sure the URL is valid? Mark

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          A 1 Reply Last reply
          0
          • M Mark Salsbery

            From the docs: ERROR_INTERNET_TIMEOUT 12002 The request has timed out. Are you sure the URL is valid? Mark

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            A Offline
            A Offline
            Amar Sutar
            wrote on last edited by
            #5

            Yes it is a Valid URL.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups