Virtual Serial Port Tools - Advanced serial port configurations for your custom ports usage scenario
Download Virtual Serial Port Tools Hide this button

IRemotePortDevice Interface

This interface is implemented by a remote port device.


interface IRemotePortDevice extends ${IDevice} {
    // Properties
    ${remoteHost}: string;
    ${remotePort}: number;
    ${connectionTimeout}: number;
    ${connectionAttempts}: number;
    ${login}: string;
    ${password}: string;
    ${domain}: string;
public interface IRemotePortDevice : ${IDevice}
    // Properties
    string ${remoteHost} { get; set; }
    uint ${remotePort} { get; set; }
    uint ${connectionTimeout} { get; set; }
    uint ${connectionAttempts} { get; set; }
    string ${login} { get; set; }
    string ${password} { set; }
    string ${domain} { get; set; }
struct IRemotePortDevice : IDevice
    // Properties
    _bstr_t ${remoteHost};  // get set 
    unsigned int ${remotePort};  // get set 
    unsigned int ${connectionTimeout};  // get set 
    unsigned int ${connectionAttempts};  // get set 
    _bstr_t ${login};  // get set 
    _bstr_t ${password};  // set 
    _bstr_t ${domain};  // get set 

IRemotePortDevice Properties


remoteHost: string;
string remoteHost { get; set; }
_bstr_t remoteHost;  // get set 

Name or address of a remote host this port is associated with.


remotePort: number;
uint remotePort { get; set; }
unsigned int remotePort;  // get set 

Port number on a remote server (specified by remoteHost property) this port is associated with.


connectionTimeout: number;
uint connectionTimeout { get; set; }
unsigned int connectionTimeout;  // get set 

Connection timeout, in milliseconds. When the local port is opened by application, an attempt to establish connection is made for a given number of milliseconds before returning error code.


connectionAttempts: number;
uint connectionAttempts { get; set; }
unsigned int connectionAttempts;  // get set 

Number of connection attempts before giving up.


login: string;
string login { get; set; }
_bstr_t login;  // get set 

User name for authentication on the remote server.


password: string;
string password { set; }
_bstr_t password;  // set 

User password for authentication on the remote server. For security reasons, this property is write-only.


domain: string;
string domain { get; set; }
_bstr_t domain;  // get set 

User domain name (optional) for authentication on the remote server.


The following code snippet illustrates the creation and configuration of a remote virtual serial port:

// The following function gets the name of the remote server
// and its port number, as well as user credentials,  creates a virtual serial port, connects
// it to the server and returns the port name
function connectPort(remoteHost: string, remotePort: number, login: string, 
        password: string, domain: string) : string {
    var library = (IRemotePortLibrary) new ActiveXObject("hhdvspkit.SerialPortLibrary.1");
    var port = library.createRemotePort();

    port.remoteHost = remoteHost;
    port.remotePort = remotePort;
    port.login = login;
    port.password = password;
    port.domain = domain;

    return port.devicePath;