KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Specifying Server Address for Built 4D Client Server Applications
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: January 30, 2023

4D has various built in features that allow built 4D Clients and Servers to function. One of the move variable issues with a C/S deployment is what the address of the Server might be. Because this is not consistent across all databases and deployments, there are many ways implemented to allow a 4D Client to find the Server.

In some cases, such as not using the default Application port value of 19813, the 4D Client may not be able to automatically find the server. The server can be manually specified if the Server Connection Dialog is enabled. The server's address will then be stored into a .4Dlink file.
A downside of this is that when the automatic update feature is used, it can replace the .4Dlink file with the default one that no longer contains the address.

The address can be applied by specifying it in the buildApp.4DSettings xml formatted file.
There are two keys that can be applied, one for the address and one for the port.
Both are under the XML path: Preferences4D/BuildApp/CS/
The address is which can be any valid address, even a DNS.
The port is which is the port applied from the database settings.
These values are not available from the Build Wizard and are only available by interacting with the file directly.

Example:

<Preferences4D>
   ...
   
<BuildApp>
      ...
      
<CS>
         ...
         <IPAddress>123.456.789.0</IPAddress>
         <PortNumber>19823</PortNumber>
         ...
      </CS>
      ...
   
</BuildApp>
   ...
</Preferences4D>


The example above will generate a 4dlink file in the build which will connect to 123.456.789.0:19823.

Documentation:
https://livedoc.4d.com/4D-XML-Keys-BuildApplication-19/CS/IPAddress.300-5447539.en.html
https://livedoc.4d.com/4D-XML-Keys-BuildApplication-19/CS/PortNumber.300-5447538.en.html