Program Logic Question

D

Derek Timothy

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
 
J

John Blessing

Derek Timothy said:
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

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 filesystemobject
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
 
A

Andrew Durstewitz

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.
 
D

Derek Timothy

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
 
D

Derek Timothy

Andrew,

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

All the best,
Derek
 
T

Tim Williams

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
 
D

Derek Timothy

Tim,

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

TIA,
Derek
 
T

Tim Williams

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.querystring("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
 
D

Derek Timothy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top