p
p
This commit is contained in:
parent
2937d799ae
commit
ccc7ea5b25
2 changed files with 9 additions and 6 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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; }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue