How to Change the Port on Datasnap Server by INI File

Asked

Viewed 556 times

1

I’m trying to set up a file INI to be open to the customer, to be able to connect to the service by the port determined by the same.

With no problems, change in design mode, compile the executed project and start working on the port as expected. However, I need the service to grab the INI file port, it always picks up the design mode, I tried to change before starting the service but I did not succeed.

I create project by the following way:

File->New->Other->Datasnap Server

How do I change the door number?

OBS: I’m using the Delphi XE7

1 answer

1


I decided as follows:

When you create the Datasnap Server project, one of the classes responsible for connection and communication is the ServerContainerUnit, in this class contains a connection component called DSServer1 which by default comes as AutoStart activated.

To solve my problem, I disabled the AutoStart component, and in Create, I added the code:

DSHTTPService1.SetHttpPort(porta);
DSServer1.Start;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.