2020-03-12 16:23:21 +08:00
|
|
|
|
using System;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
|
|
namespace LeanCloud.Realtime.Internal.Router {
|
|
|
|
|
internal class LCRTMServer {
|
|
|
|
|
[JsonProperty("groupId")]
|
|
|
|
|
internal string GroupId {
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[JsonProperty("groupUrl")]
|
|
|
|
|
internal string GroupUrl {
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[JsonProperty("server")]
|
2020-04-02 18:15:16 +08:00
|
|
|
|
internal string Primary {
|
2020-03-12 16:23:21 +08:00
|
|
|
|
get; set;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[JsonProperty("secondary")]
|
|
|
|
|
internal string Secondary {
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[JsonProperty("ttl")]
|
|
|
|
|
internal int Ttl {
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DateTimeOffset createdAt;
|
|
|
|
|
|
|
|
|
|
internal LCRTMServer() {
|
|
|
|
|
createdAt = DateTimeOffset.Now;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal bool IsValid => DateTimeOffset.Now < createdAt + TimeSpan.FromSeconds(Ttl);
|
|
|
|
|
}
|
|
|
|
|
}
|