2

I have written some standalone apps with IW11, which worked fine, but maybe there are some better ways to solve some problems like global variables. After updating to IW12 on Delphi XE2 my apps are not running anymore and I don't know how to solve it:

In SCFORM.PAS I created a new form for the standalone server app. On this, I placed some database controls to check the connection of the customers oracle database and read some parameters.

For session monitoring I use an array (session data is stored in database too). The port was changed after reading parameter info from database with

GServerControler.Port := portnum;

But after running the app, I can not connect to it with http:\\127.0.0.1:(portnum); I guess that the port change is not working?

So, my questions are:

  • how to change the port at runtime
  • how to change pool size at runtime
  • is the use of global variables in SCFORM.PAS correct (for session monitoring) or should I use another way?

At the moment there are about 50 of 500 users online at the same time, but it may be more in future.

Benjamin W.
  • 46,058
  • 19
  • 106
  • 116
  • your app is running as a service or you deploy directly the dll in the IIS pool? in general, the IWServiceController's port is the one you put after localhost. Any other change made on the service controller needs an pool restart. – RBA Apr 01 '12 at 20:09
  • As I wrote I am using the standalone server version of IW, no service or dll. In older IW Versions there was a command like "IWHTTPServer.ForcePortRefresh", but in IW12 this command does not exist?! – user1304759 Apr 02 '12 at 06:40

1 Answers1

0

If you save the port number to an ini file, for example, you can load that value using a timer on the ServerController. It doesn't seem to work properly simply loading in OnCreate. I set my timer to the default of 1000 and disabled it after running the code.

I use a CustomStandalone form and have an edit box on it that the user can use to change the port number. I load the port value in OnCreate and assign it to GServerController.Port.

Benjamin W.
  • 46,058
  • 19
  • 106
  • 116
fullerm
  • 406
  • 1
  • 8
  • 23