NetTalk Central

Author Topic: How do I know when the WebServer is busy and not  (Read 4100 times)

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
How do I know when the WebServer is busy and not
« on: November 30, 2009, 07:14:35 AM »
Hallo,

I have a web server and this web server receive files from a web client. I need to know when this web server is in process of receiving a file and when he finish and is not busy anymore.


Thank you ,

Regards,
Robert Iliuta

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How do I know when the WebServer is busy and not
« Reply #1 on: November 30, 2009, 09:28:05 PM »
Hi Robert,

I guess the easiest way is to keep a thread counter in WebHandler.

ie at the start of WebHandler increment a global thread counter, and at the end of it decrement the counter. If the counter > 0 then there are threads currently processing requests.

Cheers
Bruce

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: How do I know when the WebServer is busy and not
« Reply #2 on: December 01, 2009, 12:41:20 AM »
Hallo Bruce,


Where is the WebHandler start and close ? Can you point me on the right direction ? Also if this global variable is threaded , how can I use this in WebServer procedure? I need a flag when is busy or not ....  In WebServer I have a prompt updated: BUSY or NOT BUSY based on that flag.

Thank you,
Robert

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How do I know when the WebServer is busy and not
« Reply #3 on: December 01, 2009, 06:45:49 AM »
Hi Robert,

>> Where is the WebHandler start and close ? Can you point me on the right direction ?

The WebHandler is a normal Clarion procedure. See attached picture.

>> Also if this global variable is threaded , how can I use this in WebServer procedure?

It's not supposed to be Threaded. It's supposed to be non threaded. (That's kinda the point).

>> I need a flag when is busy or not

If the counter >0 then it's busy. If it's = 0 then it's not busy.

Cheers
Bruce



[attachment deleted by admin]

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: How do I know when the WebServer is busy and not
« Reply #4 on: December 01, 2009, 10:47:31 AM »
Hallo Bruce,

YOU are the BEST !

It works wonderful .

Thank you very much for help.

Regards,
Robert