|<code><b>client:connect</b>($host as xs:string, $port as xs:integer, $user as xs:string, $password as xs:string) as xs:anyURI</code><br/ >
|-
| valign='top' | '''Summary'''
|This function establishes a connection to a remote BaseX server, creates a new client session, and returns a session id. The parameter <code>$host</code> is the name of the database server, <code>$port</code> specifies the server port, and <code>$user</code> and <code>$password</code> represent the login data.
|-
|'''Errors'''
|'''[[#BXCL0001|BXCL0001]]''' is raised if an error occurs while creating a new session (possible reasons: server not available, access denied).<br/>