Program Logic Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Derek Timothy

    Program Logic Question

    Hello All,

    I have written a little VB program to send packets of data to my web server
    every 5 seconds in the form of a small csv file. The idea is to have a live
    (or almost live) "call status" web page running in ASP making use of the
    data in the csv file.

    So what I have done it to write a service in VB on the server that looks for
    the csv file every 5 seconds and if it is found it creates a new asp page
    with an autorefresh meta tag and copies it to wwwroot. It is virtually live
    and my manager from anywhere in the world can see the status of service
    calls.

    I think it is a good idea but my programs hang after half an hour and I am
    beginning to wonder if I have some sort of locking issue or if I am going
    about this the right way.

    I had thought of scrapping the service part altogether and just using a
    single ASP page with an autorefresh that reads in the csv file data using
    the FileSystem object, but surely that could be at risk of locking problems
    as well (if the FTP were trying to overwrite the existing file, while the
    asp page is trying to read it). Perhaps not, I'm not sure. Really I'm just
    looking for re-assurance that my new idea will work before I go too far down
    the wrong path. If not, any other ideas or tips would be much appreciated.

    Best Regards,
    Derek





  • John Blessing

    #2
    Re: Program Logic Question

    "Derek Timothy" <derek@leonas.d emon.co.uk> wrote in message
    news:en9U4r1PDH A.3192@TK2MSFTN GP10.phx.gbl...[color=blue]
    > Hello All,
    >
    > I have written a little VB program to send packets of data to my web[/color]
    server[color=blue]
    > every 5 seconds in the form of a small csv file. The idea is to have a[/color]
    live[color=blue]
    > (or almost live) "call status" web page running in ASP making use of the
    > data in the csv file.
    >
    > So what I have done it to write a service in VB on the server that looks[/color]
    for[color=blue]
    > the csv file every 5 seconds and if it is found it creates a new asp page
    > with an autorefresh meta tag and copies it to wwwroot. It is virtually[/color]
    live[color=blue]
    > and my manager from anywhere in the world can see the status of service
    > calls.
    >
    > I think it is a good idea but my programs hang after half an hour and I am
    > beginning to wonder if I have some sort of locking issue or if I am going
    > about this the right way.
    >
    > I had thought of scrapping the service part altogether and just using a
    > single ASP page with an autorefresh that reads in the csv file data using
    > the FileSystem object, but surely that could be at risk of locking[/color]
    problems[color=blue]
    > as well (if the FTP were trying to overwrite the existing file, while the
    > asp page is trying to read it). Perhaps not, I'm not sure. Really I'm just
    > looking for re-assurance that my new idea will work before I go too far[/color]
    down[color=blue]
    > the wrong path. If not, any other ideas or tips would be much appreciated.
    >
    > Best Regards,
    > Derek
    >[/color]

    maybe a memory leak in your VB app? Task manager - Performance tab will
    show you if this is the case. Maybe the event log can tell you what is
    happening? Personally I would have chosen the .asp and filesystemobjec t
    route myself. Easy enough to tell if the file is locked for updating and try
    again later.


    --
    John Blessing
    http://www.LbeHelpdesk.com - Help Desk software at affordable prices
    http://www.free-helpdesk.com - Completely free help desk software !
    http://www.lbetoolbox.com - Remove Duplicates from MS Outlook
    http://www.lbesync.com - Synchronize two Outlook Personal Folders

    Comment

    • Andrew Durstewitz

      #3
      Re: Program Logic Question

      I would agree, it sounds like you are using more and more memory without
      releasing it. If you are using array's and whatnot make sure to kill
      them once you are done with em.

      hth,
      Andrew

      * * * Sent via DevBuilder http://www.devbuilder.org * * *
      Developer Resources for High End Developers.

      Comment

      • Derek Timothy

        #4
        Re: Program Logic Question

        John,

        Thanks for the reassurance, I'll check the vb app to make sure I destroy the
        objects cleanly and I'll give the ASP route a try.

        You mention that it is easy enough to check if the file is locked for
        update. Can you tell me how to check this?

        Many thanks in advance.
        Best Regards,
        Derek


        "John Blessing" <ntlnews@**REMO VETHIS**lbehelp desk.com> wrote in message
        news:24fMa.797$ nP.154@newsfep4-winn.server.ntl i.net...[color=blue]
        > "Derek Timothy" <derek@leonas.d emon.co.uk> wrote in message
        > news:en9U4r1PDH A.3192@TK2MSFTN GP10.phx.gbl...[color=green]
        > > Hello All,
        > >
        > > I have written a little VB program to send packets of data to my web[/color]
        > server[color=green]
        > > every 5 seconds in the form of a small csv file. The idea is to have a[/color]
        > live[color=green]
        > > (or almost live) "call status" web page running in ASP making use of the
        > > data in the csv file.
        > >
        > > So what I have done it to write a service in VB on the server that looks[/color]
        > for[color=green]
        > > the csv file every 5 seconds and if it is found it creates a new asp[/color][/color]
        page[color=blue][color=green]
        > > with an autorefresh meta tag and copies it to wwwroot. It is virtually[/color]
        > live[color=green]
        > > and my manager from anywhere in the world can see the status of service
        > > calls.
        > >
        > > I think it is a good idea but my programs hang after half an hour and I[/color][/color]
        am[color=blue][color=green]
        > > beginning to wonder if I have some sort of locking issue or if I am[/color][/color]
        going[color=blue][color=green]
        > > about this the right way.
        > >
        > > I had thought of scrapping the service part altogether and just using a
        > > single ASP page with an autorefresh that reads in the csv file data[/color][/color]
        using[color=blue][color=green]
        > > the FileSystem object, but surely that could be at risk of locking[/color]
        > problems[color=green]
        > > as well (if the FTP were trying to overwrite the existing file, while[/color][/color]
        the[color=blue][color=green]
        > > asp page is trying to read it). Perhaps not, I'm not sure. Really I'm[/color][/color]
        just[color=blue][color=green]
        > > looking for re-assurance that my new idea will work before I go too far[/color]
        > down[color=green]
        > > the wrong path. If not, any other ideas or tips would be much[/color][/color]
        appreciated.[color=blue][color=green]
        > >
        > > Best Regards,
        > > Derek
        > >[/color]
        >
        > maybe a memory leak in your VB app? Task manager - Performance tab will
        > show you if this is the case. Maybe the event log can tell you what is
        > happening? Personally I would have chosen the .asp and filesystemobjec t
        > route myself. Easy enough to tell if the file is locked for updating and[/color]
        try[color=blue]
        > again later.
        >
        >
        > --
        > John Blessing
        > http://www.LbeHelpdesk.com - Help Desk software at affordable prices
        > http://www.free-helpdesk.com - Completely free help desk software !
        > http://www.lbetoolbox.com - Remove Duplicates from MS Outlook
        > http://www.lbesync.com - Synchronize two Outlook Personal Folders
        >[/color]


        Comment

        • Derek Timothy

          #5
          Re: Program Logic Question

          Andrew,

          Thanks for the tip. I'll check out the VB app and make sure I cleanly
          destroy the objects.

          All the best,
          Derek

          "Andrew Durstewitz" <adurstew@devbu ilder.org> wrote in message
          news:3f018c01$0 $198$75868355@n ews.frii.net...[color=blue]
          > I would agree, it sounds like you are using more and more memory without
          > releasing it. If you are using array's and whatnot make sure to kill
          > them once you are done with em.
          >
          > hth,
          > Andrew
          >
          > * * * Sent via DevBuilder http://www.devbuilder.org * * *
          > Developer Resources for High End Developers.[/color]


          Comment

          • Tim Williams

            #6
            Re: Program Logic Question

            Are you sending too much data to just stuff it in a querystring and send it
            directly to an ASP page which can create the "static" page?
            That would save you from having to run another VB component on the
            server....

            tim


            "Derek Timothy" <derek@leonas.d emon.co.uk> wrote in message
            news:en9U4r1PDH A.3192@TK2MSFTN GP10.phx.gbl...[color=blue]
            > Hello All,
            >
            > I have written a little VB program to send packets of data to my web[/color]
            server[color=blue]
            > every 5 seconds in the form of a small csv file. The idea is to have a[/color]
            live[color=blue]
            > (or almost live) "call status" web page running in ASP making use of the
            > data in the csv file.
            >
            > So what I have done it to write a service in VB on the server that looks[/color]
            for[color=blue]
            > the csv file every 5 seconds and if it is found it creates a new asp page
            > with an autorefresh meta tag and copies it to wwwroot. It is virtually[/color]
            live[color=blue]
            > and my manager from anywhere in the world can see the status of service
            > calls.
            >
            > I think it is a good idea but my programs hang after half an hour and I am
            > beginning to wonder if I have some sort of locking issue or if I am going
            > about this the right way.
            >
            > I had thought of scrapping the service part altogether and just using a
            > single ASP page with an autorefresh that reads in the csv file data using
            > the FileSystem object, but surely that could be at risk of locking[/color]
            problems[color=blue]
            > as well (if the FTP were trying to overwrite the existing file, while the
            > asp page is trying to read it). Perhaps not, I'm not sure. Really I'm just
            > looking for re-assurance that my new idea will work before I go too far[/color]
            down[color=blue]
            > the wrong path. If not, any other ideas or tips would be much appreciated.
            >
            > Best Regards,
            > Derek
            >
            >
            >
            >
            >[/color]


            Comment

            • Derek Timothy

              #7
              Re: Program Logic Question

              Tim,

              I'm certainly not sending a lot of data and I hadn't considered this option,
              how would it work?

              TIA,
              Derek



              "Tim Williams" <saxifrax@pacbe llremovethis.ne t> wrote in message
              news:eCNvxvDQDH A.1556@TK2MSFTN GP10.phx.gbl...[color=blue]
              > Are you sending too much data to just stuff it in a querystring and send[/color]
              it[color=blue]
              > directly to an ASP page which can create the "static" page?
              > That would save you from having to run another VB component on the
              > server....
              >
              > tim
              >
              >
              > "Derek Timothy" <derek@leonas.d emon.co.uk> wrote in message
              > news:en9U4r1PDH A.3192@TK2MSFTN GP10.phx.gbl...[color=green]
              > > Hello All,
              > >
              > > I have written a little VB program to send packets of data to my web[/color]
              > server[color=green]
              > > every 5 seconds in the form of a small csv file. The idea is to have a[/color]
              > live[color=green]
              > > (or almost live) "call status" web page running in ASP making use of the
              > > data in the csv file.
              > >
              > > So what I have done it to write a service in VB on the server that looks[/color]
              > for[color=green]
              > > the csv file every 5 seconds and if it is found it creates a new asp[/color][/color]
              page[color=blue][color=green]
              > > with an autorefresh meta tag and copies it to wwwroot. It is virtually[/color]
              > live[color=green]
              > > and my manager from anywhere in the world can see the status of service
              > > calls.
              > >
              > > I think it is a good idea but my programs hang after half an hour and I[/color][/color]
              am[color=blue][color=green]
              > > beginning to wonder if I have some sort of locking issue or if I am[/color][/color]
              going[color=blue][color=green]
              > > about this the right way.
              > >
              > > I had thought of scrapping the service part altogether and just using a
              > > single ASP page with an autorefresh that reads in the csv file data[/color][/color]
              using[color=blue][color=green]
              > > the FileSystem object, but surely that could be at risk of locking[/color]
              > problems[color=green]
              > > as well (if the FTP were trying to overwrite the existing file, while[/color][/color]
              the[color=blue][color=green]
              > > asp page is trying to read it). Perhaps not, I'm not sure. Really I'm[/color][/color]
              just[color=blue][color=green]
              > > looking for re-assurance that my new idea will work before I go too far[/color]
              > down[color=green]
              > > the wrong path. If not, any other ideas or tips would be much[/color][/color]
              appreciated.[color=blue][color=green]
              > >
              > > Best Regards,
              > > Derek
              > >
              > >
              > >
              > >
              > >[/color]
              >
              >[/color]


              Comment

              • Tim Williams

                #8
                Re: Program Logic Question

                If you can just create a single string containing all of your data (joined
                with appropriate delimitors and urlencoded) then you can send it to your ASP
                page using the xmlhttp component and a GET request.

                eg:

                GET: update.asp?info =blahblahblah

                the asp page just reformats the value of request.queryst ring("info") and
                using the FSO either overwrites the existing "static" page with the new info
                or overwrites an include file used in the static page. That way you don't
                need a component on the server.

                Tim




                "Derek Timothy" <derek.timothy@ bull.co.uk> wrote in message
                news:uk#5oQKQDH A.2700@tk2msftn gp13.phx.gbl...[color=blue]
                > Tim,
                >
                > I'm certainly not sending a lot of data and I hadn't considered this[/color]
                option,[color=blue]
                > how would it work?
                >
                > TIA,
                > Derek
                >
                >
                >
                > "Tim Williams" <saxifrax@pacbe llremovethis.ne t> wrote in message
                > news:eCNvxvDQDH A.1556@TK2MSFTN GP10.phx.gbl...[color=green]
                > > Are you sending too much data to just stuff it in a querystring and send[/color]
                > it[color=green]
                > > directly to an ASP page which can create the "static" page?
                > > That would save you from having to run another VB component on the
                > > server....
                > >
                > > tim
                > >
                > >
                > > "Derek Timothy" <derek@leonas.d emon.co.uk> wrote in message
                > > news:en9U4r1PDH A.3192@TK2MSFTN GP10.phx.gbl...[color=darkred]
                > > > Hello All,
                > > >
                > > > I have written a little VB program to send packets of data to my web[/color]
                > > server[color=darkred]
                > > > every 5 seconds in the form of a small csv file. The idea is to have a[/color]
                > > live[color=darkred]
                > > > (or almost live) "call status" web page running in ASP making use of[/color][/color][/color]
                the[color=blue][color=green][color=darkred]
                > > > data in the csv file.
                > > >
                > > > So what I have done it to write a service in VB on the server that[/color][/color][/color]
                looks[color=blue][color=green]
                > > for[color=darkred]
                > > > the csv file every 5 seconds and if it is found it creates a new asp[/color][/color]
                > page[color=green][color=darkred]
                > > > with an autorefresh meta tag and copies it to wwwroot. It is virtually[/color]
                > > live[color=darkred]
                > > > and my manager from anywhere in the world can see the status of[/color][/color][/color]
                service[color=blue][color=green][color=darkred]
                > > > calls.
                > > >
                > > > I think it is a good idea but my programs hang after half an hour and[/color][/color][/color]
                I[color=blue]
                > am[color=green][color=darkred]
                > > > beginning to wonder if I have some sort of locking issue or if I am[/color][/color]
                > going[color=green][color=darkred]
                > > > about this the right way.
                > > >
                > > > I had thought of scrapping the service part altogether and just using[/color][/color][/color]
                a[color=blue][color=green][color=darkred]
                > > > single ASP page with an autorefresh that reads in the csv file data[/color][/color]
                > using[color=green][color=darkred]
                > > > the FileSystem object, but surely that could be at risk of locking[/color]
                > > problems[color=darkred]
                > > > as well (if the FTP were trying to overwrite the existing file, while[/color][/color]
                > the[color=green][color=darkred]
                > > > asp page is trying to read it). Perhaps not, I'm not sure. Really I'm[/color][/color]
                > just[color=green][color=darkred]
                > > > looking for re-assurance that my new idea will work before I go too[/color][/color][/color]
                far[color=blue][color=green]
                > > down[color=darkred]
                > > > the wrong path. If not, any other ideas or tips would be much[/color][/color]
                > appreciated.[color=green][color=darkred]
                > > >
                > > > Best Regards,
                > > > Derek
                > > >
                > > >
                > > >
                > > >
                > > >[/color]
                > >
                > >[/color]
                >
                >[/color]


                Comment

                • Derek Timothy

                  #9
                  Re: Program Logic Question

                  Tim,

                  This is an excellent idea, I really hadn't thought of this. It would avoid
                  me having to use the Internet Transfer control and FTP, it always seems a
                  bit flakey. Thanks a lot for this suggestion, I'm going to give it a go.

                  All the best,
                  Derek


                  "Tim Williams" <saxifrax@pacbe llremovethis.ne t> wrote in message
                  news:#k$lkqNQDH A.2316@TK2MSFTN GP12.phx.gbl...[color=blue]
                  > If you can just create a single string containing all of your data (joined
                  > with appropriate delimitors and urlencoded) then you can send it to your[/color]
                  ASP[color=blue]
                  > page using the xmlhttp component and a GET request.
                  >
                  > eg:
                  >
                  > GET: update.asp?info =blahblahblah
                  >
                  > the asp page just reformats the value of request.queryst ring("info") and
                  > using the FSO either overwrites the existing "static" page with the new[/color]
                  info[color=blue]
                  > or overwrites an include file used in the static page. That way you don't
                  > need a component on the server.
                  >
                  > Tim
                  >
                  >
                  >
                  >
                  > "Derek Timothy" <derek.timothy@ bull.co.uk> wrote in message
                  > news:uk#5oQKQDH A.2700@tk2msftn gp13.phx.gbl...[color=green]
                  > > Tim,
                  > >
                  > > I'm certainly not sending a lot of data and I hadn't considered this[/color]
                  > option,[color=green]
                  > > how would it work?
                  > >
                  > > TIA,
                  > > Derek
                  > >
                  > >
                  > >
                  > > "Tim Williams" <saxifrax@pacbe llremovethis.ne t> wrote in message
                  > > news:eCNvxvDQDH A.1556@TK2MSFTN GP10.phx.gbl...[color=darkred]
                  > > > Are you sending too much data to just stuff it in a querystring and[/color][/color][/color]
                  send[color=blue][color=green]
                  > > it[color=darkred]
                  > > > directly to an ASP page which can create the "static" page?
                  > > > That would save you from having to run another VB component on the
                  > > > server....
                  > > >
                  > > > tim
                  > > >
                  > > >
                  > > > "Derek Timothy" <derek@leonas.d emon.co.uk> wrote in message
                  > > > news:en9U4r1PDH A.3192@TK2MSFTN GP10.phx.gbl...
                  > > > > Hello All,
                  > > > >
                  > > > > I have written a little VB program to send packets of data to my web
                  > > > server
                  > > > > every 5 seconds in the form of a small csv file. The idea is to have[/color][/color][/color]
                  a[color=blue][color=green][color=darkred]
                  > > > live
                  > > > > (or almost live) "call status" web page running in ASP making use of[/color][/color]
                  > the[color=green][color=darkred]
                  > > > > data in the csv file.
                  > > > >
                  > > > > So what I have done it to write a service in VB on the server that[/color][/color]
                  > looks[color=green][color=darkred]
                  > > > for
                  > > > > the csv file every 5 seconds and if it is found it creates a new asp[/color]
                  > > page[color=darkred]
                  > > > > with an autorefresh meta tag and copies it to wwwroot. It is[/color][/color][/color]
                  virtually[color=blue][color=green][color=darkred]
                  > > > live
                  > > > > and my manager from anywhere in the world can see the status of[/color][/color]
                  > service[color=green][color=darkred]
                  > > > > calls.
                  > > > >
                  > > > > I think it is a good idea but my programs hang after half an hour[/color][/color][/color]
                  and[color=blue]
                  > I[color=green]
                  > > am[color=darkred]
                  > > > > beginning to wonder if I have some sort of locking issue or if I am[/color]
                  > > going[color=darkred]
                  > > > > about this the right way.
                  > > > >
                  > > > > I had thought of scrapping the service part altogether and just[/color][/color][/color]
                  using[color=blue]
                  > a[color=green][color=darkred]
                  > > > > single ASP page with an autorefresh that reads in the csv file data[/color]
                  > > using[color=darkred]
                  > > > > the FileSystem object, but surely that could be at risk of locking
                  > > > problems
                  > > > > as well (if the FTP were trying to overwrite the existing file,[/color][/color][/color]
                  while[color=blue][color=green]
                  > > the[color=darkred]
                  > > > > asp page is trying to read it). Perhaps not, I'm not sure. Really[/color][/color][/color]
                  I'm[color=blue][color=green]
                  > > just[color=darkred]
                  > > > > looking for re-assurance that my new idea will work before I go too[/color][/color]
                  > far[color=green][color=darkred]
                  > > > down
                  > > > > the wrong path. If not, any other ideas or tips would be much[/color]
                  > > appreciated.[color=darkred]
                  > > > >
                  > > > > Best Regards,
                  > > > > Derek
                  > > > >
                  > > > >
                  > > > >
                  > > > >
                  > > > >
                  > > >
                  > > >[/color]
                  > >
                  > >[/color]
                  >
                  >[/color]


                  Comment

                  Working...