/// <summary>创建在线</summary> /// <param name="sessionid"></param> /// <returns></returns> protected virtual DeviceOnline CreateOnline(String sessionid) { var ns = Session as NetSession; var sid = ns.Remote.EndPoint + ""; var olt = DeviceOnline.GetOrAdd(sid); olt.CreateIP = ns.Remote + ""; olt.SaveAsync(); return(olt); }
/// <summary>创建在线</summary> /// <param name="sessionid"></param> /// <returns></returns> protected override IOnline CreateOnline(String sessionid) { var ns = Session as NetSession; var sid = ns.Remote.EndPoint + ""; var olt = DeviceOnline.GetOrAdd(sid); olt.ExternalUri = ns.Remote + ""; olt.SaveAsync(); return(olt); }
/// <summary>检查在线</summary> /// <returns></returns> protected virtual DeviceOnline CreateOnline(String mac, IDevice dv) { var sid = $"{mac}@{Remote.EndPoint}"; //var olt = new DeviceOnline //{ // SessionID = sid, // DeviceID = dv.ID, // Name = dv + "", // Kind = dv.Kind, //}; var olt = DeviceOnline.GetOrAdd(sid); olt.DeviceID = dv.ID; olt.Name = dv + ""; olt.Kind = dv.Kind; //olt.Insert(); olt.SaveAsync(); return(olt); }