TROZeroConfService

Overview

The TROZeroConfService class is used to hold information about discovered services in the ZeroConf environment. A TROZeroConfBrowser uses it to represent the service when informed about added and removed services via OnServiceAdded and OnServiceRemoved.
You may use this class to gain access to specific information about discovered services with the Resolve and TryResolve methods.

Note: Take a look at the BonjourDiscovery sample shipped with the Remoting SDK to see service discovery in action.

Location


 

constructor Create

Initializes the instance with the given values.

constructor Create(aBrowser: TROZeroConfBrowser; aDefEngine: TROZeroConfEngine; aDomain: UnicodeString; aServiceName: UnicodeString; aServiceType: UnicodeString; aIpType: TIpType)

Parameters:

  • aBrowser: Browser that provides information
  • aDefEngine: Engine used for discovering
  • aDomain: Service domain
  • aServiceName: Service name
  • aServiceType: Service type
  • aIpType: TIpType value

Address

Holds the server IP address. If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property Address: string read

Domain

Holds information about the service domain.

property Domain: UnicodeString read

FullDomainName

Holds the full name of the domain. If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property FullDomainName: UnicodeString read

HostTarget

Holds the target server host name. If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property HostTarget: UnicodeString read

IP4Address

Holds the server IP address in an IPv4 form (empty if ResolvedIP4 if false). If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property IP4Address: string read

IP6Address

Holds the server IP address in an IPv6 form (empty if ResolvedIP6 if false). If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property IP6Address: string read

Port

Specifies the port that is used by the server that hosts the current service. If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property Port: Cardinal read

Resolve  overload

Resolves a domain and the service type and -name to a real address and port with a 10 second timeout. If the resolve operation was terminated by timeout or if the server returns an error, an Exception will be raised.

procedure Resolve

Resolve (Integer)  overload

Resolves a domain and the service type and -name to a real address and port with the provided timeout (in seconds). If the resolve operation was terminated by timeout or if the server returns an error, an Exception will be raised.

procedure Resolve(aTimeout: Integer)

Parameters:

  • aTimeout: Timeout (in seconds)

Resolved

Indicates if the server adress and port are already resolved.

property Resolved: Boolean read

ResolvedIP4

Indicates if the server adress is in IPv4 form. If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property ResolvedIP4: Boolean read

ResolvedIP6

Indicates if the server adress is in IPv6 form. If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property ResolvedIP6: Boolean read

ServiceName

Holds the name of the service.

property ServiceName: UnicodeString read

ServiceType

Holds the service type name.

property ServiceType: UnicodeString read

TextRecord

Returns a string in form of name=value pairs delimited by carriage returns and line feeds. It holds additional information received from the server and may be used to obtain additional information like server channel and message type etc. If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property TextRecord: UnicodeString read

TryResolve  overload

Tries to resolve a domain and the service type and -name to a real address and port with a 10 second timeout. If the resolve operation was terminated by timeout or if the server returns an error, this method will return false.

function TryResolve: Boolean

TryResolve (Integer): Boolean  overload

Tries to resolve a domain and the service type and -name to a real address and port with the provided timeout (in seconds). If the resolve operation was terminated by timeout or if the server returns an error, this method will return false.

function TryResolve(aTimeout: Integer): Boolean

Parameters:

  • aTimeout: Timeout (in seconds)

 

Address

Holds the server IP address. If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property Address: string read

Domain

Holds information about the service domain.

property Domain: UnicodeString read

FullDomainName

Holds the full name of the domain. If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property FullDomainName: UnicodeString read

HostTarget

Holds the target server host name. If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property HostTarget: UnicodeString read

IP4Address

Holds the server IP address in an IPv4 form (empty if ResolvedIP4 if false). If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property IP4Address: string read

IP6Address

Holds the server IP address in an IPv6 form (empty if ResolvedIP6 if false). If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property IP6Address: string read

Port

Specifies the port that is used by the server that hosts the current service. If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property Port: Cardinal read

Resolved

Indicates if the server adress and port are already resolved.

property Resolved: Boolean read

ResolvedIP4

Indicates if the server adress is in IPv4 form. If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property ResolvedIP4: Boolean read

ResolvedIP6

Indicates if the server adress is in IPv6 form. If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property ResolvedIP6: Boolean read

ServiceName

Holds the name of the service.

property ServiceName: UnicodeString read

ServiceType

Holds the service type name.

property ServiceType: UnicodeString read

TextRecord

Returns a string in form of name=value pairs delimited by carriage returns and line feeds. It holds additional information received from the server and may be used to obtain additional information like server channel and message type etc. If the host is not resolved yet, the Exception 'Not resolved yet' will be raised when you try access this property.

property TextRecord: UnicodeString read

 

constructor Create

Initializes the instance with the given values.

constructor Create(aBrowser: TROZeroConfBrowser; aDefEngine: TROZeroConfEngine; aDomain: UnicodeString; aServiceName: UnicodeString; aServiceType: UnicodeString; aIpType: TIpType)

Parameters:

  • aBrowser: Browser that provides information
  • aDefEngine: Engine used for discovering
  • aDomain: Service domain
  • aServiceName: Service name
  • aServiceType: Service type
  • aIpType: TIpType value

Resolve  overload

Resolves a domain and the service type and -name to a real address and port with a 10 second timeout. If the resolve operation was terminated by timeout or if the server returns an error, an Exception will be raised.

procedure Resolve

Resolve (Integer)  overload

Resolves a domain and the service type and -name to a real address and port with the provided timeout (in seconds). If the resolve operation was terminated by timeout or if the server returns an error, an Exception will be raised.

procedure Resolve(aTimeout: Integer)

Parameters:

  • aTimeout: Timeout (in seconds)

TryResolve  overload

Tries to resolve a domain and the service type and -name to a real address and port with a 10 second timeout. If the resolve operation was terminated by timeout or if the server returns an error, this method will return false.

function TryResolve: Boolean

TryResolve (Integer): Boolean  overload

Tries to resolve a domain and the service type and -name to a real address and port with the provided timeout (in seconds). If the resolve operation was terminated by timeout or if the server returns an error, this method will return false.

function TryResolve(aTimeout: Integer): Boolean

Parameters:

  • aTimeout: Timeout (in seconds)