2017-04-24 21:04:52 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Net.Sockets;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2017-05-12 21:05:18 +00:00
|
|
|
|
using Square;
|
|
|
|
|
using Kneesocks;
|
2017-04-24 21:04:52 +00:00
|
|
|
|
|
|
|
|
|
namespace CircleScape {
|
2017-05-12 21:05:18 +00:00
|
|
|
|
class PendingConnection : Connection {
|
|
|
|
|
private DateTime ConnectionOpened;
|
|
|
|
|
|
2017-05-17 21:06:16 +00:00
|
|
|
|
|
|
|
|
|
|
2017-05-12 21:05:18 +00:00
|
|
|
|
protected override void OnOpen() {
|
|
|
|
|
ConnectionOpened = DateTime.UtcNow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnParse() {
|
|
|
|
|
if((DateTime.UtcNow - ConnectionOpened).Seconds > 60) {
|
|
|
|
|
Disconnect(Frame.kClosingReason.ProtocolError, "Logon request timed out.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnReceive(byte[] data) {
|
|
|
|
|
Console.WriteLine(Id + " says " + data.GetString());
|
|
|
|
|
}
|
2017-04-24 21:04:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|