KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Pre-Configure Server Connections with Build4D
PRODUCT: 4D | VERSION: 20 R | PLATFORM: Mac & Win
Published On: September 15, 2025

In environments with multiple 4D Servers running on the same network, 4D clients may automatically connect to an unintended server. This occurs because the default auto-discovery mechanism connects to the first available server found on port 19813, which may not be the target server.

The Build4D component provides IPAddress and portNumber attributes that allow you to embed server connection parameters directly into the compiled client application.

Syntax:

$settings.IPAddress:="x.x.x.x"
$settings.portNumber:=port_number

Example:
var $build : cs.Build4D.Client
var $settings : Object
var $success : Boolean

$settings:={}
$settings.buildName:="ProductionClient"
$settings.IPAddress:="192.168.1.100"
$settings.portNumber:=19814
$settings.destinationFolder:="Production_Client/"

$build:=cs.Client.new($settings)
$success:=$build.build()


When these attributes are specified, Build4D automatically generates an EnginedServer.4Dlink file in the client's Database folder. This file contains the predefined connection parameters, causing the client to bypass the auto-discovery process and connect directly to the specified server.

As a result the compiled client will always connect to the predetermined server, eliminating connection ambiguity in multi-server environments.