%Connect

This special method connects to a language server and returns a connection object.

The first connection is automatically the default connection, which can be used implicitly by many of the other special methods. Deleting this connection object results in no default connection being available. A new default connection can be established by using %Connect again or by using the %Set(Default) special method on an existing connection object.

All special method names and keywords are case-insensitive.

Syntax

connection = %Connect(lang-server{, port{, system{, timeout}}})

Syntax elements

connectionA DBO variable name for the connection object.

lang-serverKeyword that identifies a language server:

JAVAJava Language Server (JLS)

DOTNET.NET Language Server (DNLS)

systemHost name or IP address of the system running the language server (default is "localhost").

timeoutConnection timeout in seconds (default is wait forever).

Applicability

Language objects only. The equivalent for internal objects is %ObjMgr().

Comments

By default the Java Language Server listens on port 3090, the 32-bit .NET Language Server on port 3091, and the 64-bit version on port 3092. However, these defaults can be overridden by the DBO Configuration File (DBO.cfg).

A port number of zero denotes the default port.

Examples

Makes a connection to a Java Language Server on the default port (this automatically becomes the default connection)

DefaultCxn = %Connect(JAVA)

Creates an alternate connection to a Java Language Server on a different host using the default port number.

AlternateCxn = %Connect(JAVA, 0, "fork")