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 write

Domain

Holds information about the service domain.

property Domain: UnicodeString read write

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 write

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 write

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 write

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 write

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 write

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 write

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 write

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 write

ServiceName

Holds the name of the service.

property ServiceName: UnicodeString read write

ServiceType

Holds the service type name.

property ServiceType: UnicodeString read write

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 write

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 write

Domain

Holds information about the service domain.

property Domain: UnicodeString read write

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 write

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 write

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 write

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 write

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 write

Resolved

Indicates if the server adress and port are already resolved.

property Resolved: Boolean read write

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 write

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 write

ServiceName

Holds the name of the service.

property ServiceName: UnicodeString read write

ServiceType

Holds the service type name.

property ServiceType: UnicodeString read write

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 write

 

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)

See Also