示例#1
0
        /// <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);
        }
示例#2
0
        /// <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);
        }
示例#3
0
        /// <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);
        }