RPCConnect Method

Establishes a connection to a remote server.

App.RPCConnect(Name, ConnectString)

Client support

   Newlook Smartclient

   Newlook Server

Use

The RPCConnect method establishes a physical connection to the remote server. After this action successfully completes, the connection is live and you can call remote commands or procedure calls against it and process the results.

When you have concluded your operations over an open Connection, use the Disconnect method on the connection object to terminate the connection and free any associated system resources.

Arguments

Name (string, required)

A name that you assign to the connection object that represents the connection to the RPC server. The connection will be referred to by this name in all subsequent RPC actions. For example, your Connection name might be "RPCConnection".

ConnectString (expression, Required)

A string specifying the server connection details. This parameter consists of a semi-colon separated name/value pair that can be set to one of two things:

  1. A pre-established rpc connection, OR
  2. A full connection definition specifying the rpc server and all the relevant connection properties.

Each name/pair value is formatted as so: 'name=value'. Eg.'Address=192.168.1.1;Port=4245'.

TIP!

The RPCConnect Action in the macro editor contains a display link properties editor which can assist you in creating the Connection string for this argument.

Returns

This method returns an object with a Name property set to the string specified in the Name argument.

Example

The following example connects to the remote server and issues a command to send a message to a specified user.

VB SCRIPT

Dim varNetworkAddress

Dim sConnectString

Dim sMessage

Dim sUser

varNetworkAddress = App.GetValue ("NetWorkAddress")

sConnectString = "Network Address=" & varNetworkAddress & ";Network Port=8475;Use Encryption for Data=False;Host CCSID=37;NLV=2924;User ID=;Password="

App.RpcConnect "SampleConnect", sConnectString

sMessage = App.GetValue ("Msg.Text")

sUser = App.GetValue ("Usr.Text")

SampleConnect.Command "SNDMSG MSG('" & sMessage & "') TOUSR(" & sUser & ")"

SampleConnect.Disconnect

 

JSCRIPT

varNetworkAddress = App.GetValue ("NetWorkAddress");

sConnectString = ("Network Address=" + varNetworkAddress + ";Network Port=8475;Use Encryption for Data=False;Host CCSID=37;NLV=2924;User ID=;Password=");

App.RpcConnect ("SampleConnect", sConnectString);

sMessage = App.GetValue ("Msg.Text");

sUser = App.GetValue ("Usr.Text");

SampleConnect.Command ("SNDMSG MSG('" + sMessage + "') TOUSR(" + sUser + ")");

SampleConnect.Disconnect;

 

Applies To

App object

See Also

Disconnect Method | Command Method


© 2004-2021 looksoftware. All rights reserved.