ConnectToServer (obsolete) – PB Docs 2021

ConnectToServer (obsolete)

Description

Connects a client application to a server component. The client
application must call ConnectToServer before it can use a remote object on
the server.

This function applies to distributed applications only.

Obsolete function

ConnectToServer is obsolete, because EAServer is no longer
supported since PowerBuilder 2017.

Applies to

Connection objects

Syntax

Argument

Description

connection

The name of the Connection object you want to use to
establish the connection. The Connection object has properties
that specify how the connection will be established.

Return value

Long. Returns 0 if it succeeds and one of the following values if an
error occurs:

50 — Distributed service error

52 — Distributed communications error

53 — Requested server not active

54 — Server not accepting requests

55 — Request terminated abnormally

56 — Response to request incomplete

57 — Connection object not connected to server

62 — Server busy

92 — Required property is missing or invalid

Usage

Before calling ConnectToServer, you assign values to the properties
of the Connection object.

Examples

In this example, the client application connects to a server
application using the Connection object myconnect:

You can enclose the ConnectToServer function in a try-catch block to
catch exceptions thrown during the attempt to connect. This example uses
SSLServiceProvider and SSLCallBack objects to create a secure connection.
An exception or other error in any of the SSLCallback functions raises the
CTSSecurity::UserAbortedException. The error-handling code shown in the
example displays a message box with the text of the error message, but
your code should take additional appropriate action:

See also

DisconnectServer


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x