IDeviceNetwork
Interface in Oadm.Sdk.Sites · Oadm.Sdk.dll
Network checks towards one device, routed like the device: through its site, or on the server’s own network (ITaskExecutionContext.Network, ITaskQueryContext.Network). Never open sockets to devices yourself. Through a site that cannot carry a call (offline, a site node too old) a call throws an exception whose message says why (“Site offline: Building B”).
public interface IDeviceNetworkProperties
Section titled “Properties”SiteId
Section titled “SiteId”Guid? SiteId { get; }The site of this route; null = the server’s own network.
Methods
Section titled “Methods”LocalAddressTowardsAsync
Section titled “LocalAddressTowardsAsync”Task<IPAddress?> LocalAddressTowardsAsync(string address, CancellationToken ct)The address OADM has towards address on this route: the server’s own, or the site node’s in the site network (what a device uses to reach OADM’s services, e.g. “Use OADM as NTP server”). Null when none.
PingAsync
Section titled “PingAsync”Task<bool> PingAsync(string address, TimeSpan timeout, CancellationToken ct)True when address answers a ping within timeout.
ProbeTcpAsync
Section titled “ProbeTcpAsync”Task<bool> ProbeTcpAsync(string address, int port, TimeSpan timeout, CancellationToken ct)True when a host answers on TCP port at address within timeout: it accepts the connection or actively refuses it (a refusal also proves the address is taken). The address-in-use check relies on it; the connection is closed at once.
Reaches
Section titled “Reaches”bool Reaches(IPAddress address)Default implementation
True when address is on a network this route reaches: always on the server’s own network; at a site only the networks the site node reaches (its chosen network cards and extra networks). A device at a site cannot move to an address outside them.
ResolveAsync
Section titled “ResolveAsync”Task<IReadOnlyList<IPAddress>> ResolveAsync(string name, CancellationToken ct)The addresses of a host name as this route resolves it; empty when unknown.