예제 #1
0
 public User(string firstName, string lastName, string username, string password = null)
 {
     this.Id        = HashUtil.GetUniqueId();
     this.FirstName = firstName;
     this.LastName  = lastName;
     this.Username  = username;
     this.Password  = password;
 }
 public EdgeDevice(string deviceId, string deviceName)
 {
     this.Id            = HashUtil.GetUniqueId();
     this.DeviceId      = deviceId;
     this.DeviceName    = deviceName;
     this.EventsCount   = 0;
     this.MessagesCount = 0;
 }
예제 #3
0
        public static string CreateNewSession()
        {
            string strRet = HashUtil.GetUniqueId();

            if (!SessionManager.sessionsBag.TryAdd(strRet, new SessionContainer(strRet)))
            {
                Console.WriteLine("Could not add SessionContainer to sessions bag - sessionId=[" + strRet + "]");
            }

            if (!SessionManager.sessionThreadFlag)
            {
                SessionManager.sessionThread = new Thread(new ThreadStart(ExpireIdleSessions));
                SessionManager.sessionThread.Start();
                SessionManager.sessionThreadFlag = true;
            }

            return(strRet);
        }
예제 #4
0
 public User()
 {
     this.Id = HashUtil.GetUniqueId();
 }
 public EdgeDevice(string deviceId)
 {
     this.Id         = HashUtil.GetUniqueId();
     this.DeviceId   = deviceId;
     this.DeviceName = deviceId;
 }
 public EdgeDevice()
 {
     this.Id = HashUtil.GetUniqueId();
 }