NetTalk Central

Author Topic: Change web server port at run time  (Read 3362 times)

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Change web server port at run time
« on: June 08, 2009, 02:44:41 AM »
Hallo,


There is a way to change the port at runt time ?


Thank you,
Robert

Alberto

  • Hero Member
  • *****
  • Posts: 1869
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Change web server port at run time
« Reply #1 on: June 08, 2009, 07:07:13 AM »
Mhhh I dont know if you can do it at runtime and do not imagine the reazon, but if what you want is a way to define the port outside the exe, then, define a variable as the port and at startup read it from an ini file, for exaple:

loc:port = getini('gmed','port',88,'.\gmed.ini')

Hope this helps
Alberto
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: Change web server port at run time
« Reply #2 on: June 08, 2009, 10:01:34 PM »
Hi Robert,

I use what Alberto suggested.

It is possible to actually change the port while the app is running though.
You need to .Close the server, and then .Open it again with the new port value.

Cheers
Bruce

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: Change web server port at run time
« Reply #3 on: June 09, 2009, 05:18:01 AM »
Hallo Bruce,

Now it works. Forgot about .Close the server :-)

Thank you Alberto for suggestion.

Regards,
Robert