/// <summary> /// Constructs a new observe relation. /// </summary> /// <param name="config">the config</param> /// <param name="endpoint">the observing endpoint</param> /// <param name="resource">the observed resource</param> /// <param name="exchange">the exchange that tries to establish the observe relation</param> public ObserveRelation(ICoapConfig config, ObservingEndpoint endpoint, IResource resource, Exchange exchange) { _config = config ?? throw ThrowHelper.ArgumentNull("config"); _endpoint = endpoint ?? throw ThrowHelper.ArgumentNull("endpoint"); Resource = resource ?? throw ThrowHelper.ArgumentNull("resource"); Exchange = exchange ?? throw ThrowHelper.ArgumentNull("exchange"); Key = $"{Source}#{exchange.Request.TokenString}"; }
public ObserveRelation GetRelation(System.Net.EndPoint source, Byte[] token) { ObservingEndpoint remote = GetObservingEndpoint(source); return(remote == null ? null : remote.GetObserveRelation(token)); }