Hi,
I would be grateful if someone could give me a hint on the following problem:
Since several years, I'm running a web application based on a Winsock server written by Markus Voellmy:
It uses a "pseudo multi threading" by creating a new object for each incoming connection request. My application parses incoming GET and POST requests via winsocks datarrival() event and is using the senddata() function to return HTML code, images, scripts, etc, to the clients browser.
Sometimes, escpecially when you haven't used the application for a while and open a new web browser and request a web page (with HTTP GET) from my application that has quite a lot of HTML in it, I get "Not enough memory to complete this operation". The whole application hangs and crashes with "Unhandled Exception: Access Violation (C00005)".
To track the error, I write to a log file and the error seems to happen just before the senddata() call. I have a SYS(1016) here ("Returns amount of memory being used by objects you define") and it reports 2033612 which I assume is in bytes.
I have have read somewhere that senddata() can be flooded and tried to put an inkey(.1) both after and before the sendata() but it still crashes.
I run about 20 instances of my application (one per customer) using different ports, on the same Windowss 2008 RC2 server. msvcr71.dll and the VFP dll's vfp9r.dll etc are shared by all instances.
The crashes started to happen this autumn. My application grows, i.e. I add new functionality every now and then but nothing major. The winsock class that handles everything is about 9000 lines of code and has a big "do case" command in it that parses the incoming GET and POST requests.
Any idea how I can avoid this frustrating problem?
Thanks,
Micael
I would be grateful if someone could give me a hint on the following problem:
Since several years, I'm running a web application based on a Winsock server written by Markus Voellmy:
It uses a "pseudo multi threading" by creating a new object for each incoming connection request. My application parses incoming GET and POST requests via winsocks datarrival() event and is using the senddata() function to return HTML code, images, scripts, etc, to the clients browser.
Sometimes, escpecially when you haven't used the application for a while and open a new web browser and request a web page (with HTTP GET) from my application that has quite a lot of HTML in it, I get "Not enough memory to complete this operation". The whole application hangs and crashes with "Unhandled Exception: Access Violation (C00005)".
To track the error, I write to a log file and the error seems to happen just before the senddata() call. I have a SYS(1016) here ("Returns amount of memory being used by objects you define") and it reports 2033612 which I assume is in bytes.
I have have read somewhere that senddata() can be flooded and tried to put an inkey(.1) both after and before the sendata() but it still crashes.
I run about 20 instances of my application (one per customer) using different ports, on the same Windowss 2008 RC2 server. msvcr71.dll and the VFP dll's vfp9r.dll etc are shared by all instances.
The crashes started to happen this autumn. My application grows, i.e. I add new functionality every now and then but nothing major. The winsock class that handles everything is about 9000 lines of code and has a big "do case" command in it that parses the incoming GET and POST requests.
Any idea how I can avoid this frustrating problem?
Thanks,
Micael