Click or drag to resize

RuntimeManagerConnect Method

Connects to a host with the given IP address and port.

Namespace:  OpenTestSystem.Otx.Runtime.Api
Assembly:  OpenTestSystem.Otx.Runtime.Api (in OpenTestSystem.Otx.Runtime.Api.dll) Version: 5.5.0.0 (6.1.0.31040)
Syntax
public void Connect(
	string hostIpAddress,
	int hostPort
)

Parameters

hostIpAddress
Type: SystemString
Host IP address
hostPort
Type: SystemInt32
Port of the host

Implements

IRuntimeManagerConnect(String, Int32)
Exceptions
ExceptionCondition
UnreachableHostExceptionThe host (hostIpAddress) is not listening the given port.
ConnectionExceptionConnection alreadly exists.
Examples
The following code example uses an IP address and port number to connect with a remote host.
C#
static class Program
{
    static void Main()
    { 
        RuntimeManager rt = new RuntimeManager();
        rt.Load("C:\\Sample.ptx");
        rt.Connect("192.168.1.30", 1001);
        rt.Disconnect();
        rt.Connect("127.0.0.1", 1001);//local host.
        rt.Disconnect();
    } 
}
See Also