p
This commit is contained in:
Malloc of Kuzkycyziklistan 2017-09-06 23:26:58 -05:00
parent 2937d799ae
commit ccc7ea5b25
2 changed files with 9 additions and 6 deletions

View file

@ -79,11 +79,12 @@ namespace SockScape {
}
}
if(LastMessageIn.Ticks == 0 && DeltaLastOut.TotalSeconds > 10)
Send(new Packet(kIntraSlaveId.InitiationAttempt, Configuration.General["Master Secret"]));
else {
}
if (LastMessageIn.Ticks != 0) {
if(DeltaLastOut.TotalSeconds > 2)
Send(new Packet());
} else
if(DeltaLastOut.TotalSeconds > 10)
Send(new Packet(kIntraSlaveId.InitiationAttempt, Configuration.General["Master Secret"]));
Thread.Sleep(1);
}

View file

@ -51,7 +51,8 @@ namespace SockScape {
if(packet == null)
continue;
Clients[client].LastReceive = DateTime.Now;
switch((kIntraSlaveId)packet.Id) {
case kIntraSlaveId.InitiationAttempt:
if(packet.RegionCount != 1 || IsProspectConnected(client))
@ -155,6 +156,7 @@ namespace SockScape {
class Client {
public IPEndPoint Address { get; set; }
public DateTime LastReceive { get; set; }
public TimeSpan ReceiveDelta => DateTime.Now - LastReceive;
public Cipher Encryptor { get; set; }
public Key Key { get; set; }
}